diff --git a/endpoints.md b/endpoints.md index 08b06b0..4e71e71 100644 --- a/endpoints.md +++ b/endpoints.md @@ -59,4 +59,5 @@ prefix - /`qrcode` prefix - /`quote` - `GET` quote?q (author/keyword) -- `GET` quote/random (1) \ No newline at end of file +- `GET` quote/random (1) +- `POST` quote { quote, author } \ No newline at end of file diff --git a/src/modules/quote/dtos/create-quote.dto.ts b/src/modules/quote/dtos/create-quote.dto.ts new file mode 100644 index 0000000..cd2699e --- /dev/null +++ b/src/modules/quote/dtos/create-quote.dto.ts @@ -0,0 +1,9 @@ +import { IsString } from 'class-validator'; + +export class CreateQuoteDto { + @IsString({ message: '' }) + author: string; + + @IsString({ message: '' }) + quote: string; +} diff --git a/src/modules/quote/dtos/index.ts b/src/modules/quote/dtos/index.ts new file mode 100644 index 0000000..a06862b --- /dev/null +++ b/src/modules/quote/dtos/index.ts @@ -0,0 +1 @@ +export * from './create-quote.dto'; diff --git a/src/modules/quote/index.ts b/src/modules/quote/index.ts new file mode 100644 index 0000000..56e02f7 --- /dev/null +++ b/src/modules/quote/index.ts @@ -0,0 +1,4 @@ +export * from './dtos'; +export * from './quote.controller'; +export * from './quote.module'; +export * from './quote.service'; diff --git a/src/modules/quote/quote.controller.ts b/src/modules/quote/quote.controller.ts new file mode 100644 index 0000000..7b488d6 --- /dev/null +++ b/src/modules/quote/quote.controller.ts @@ -0,0 +1,6 @@ +import { Controller } from '@nestjs/common'; +import { ApiTags } from '@nestjs/swagger'; + +@ApiTags('quote') +@Controller('quote') +export class QuoteController {} diff --git a/src/modules/quote/quote.module.ts b/src/modules/quote/quote.module.ts new file mode 100644 index 0000000..6984eb4 --- /dev/null +++ b/src/modules/quote/quote.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common'; +import { QuoteService } from './quote.service'; +import { QuoteController } from './quote.controller'; + +@Module({ + imports: [], + providers: [QuoteService], + controllers: [QuoteController], +}) +export class QuoteModule {} diff --git a/src/modules/quote/quote.service.ts b/src/modules/quote/quote.service.ts new file mode 100644 index 0000000..e6dcda8 --- /dev/null +++ b/src/modules/quote/quote.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class QuoteService {}