Skip to content

Commit

Permalink
feat: added boilerplate for module
Browse files Browse the repository at this point in the history
  • Loading branch information
KostaD02 committed Sep 30, 2023
1 parent b7b1edf commit b713199
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ prefix - /`qrcode`
prefix - /`quote`

- `GET` quote?q (author/keyword)
- `GET` quote/random (1)
- `GET` quote/random (1)
- `POST` quote { quote, author }
9 changes: 9 additions & 0 deletions src/modules/quote/dtos/create-quote.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { IsString } from 'class-validator';

export class CreateQuoteDto {
@IsString({ message: '' })
author: string;

@IsString({ message: '' })
quote: string;
}
1 change: 1 addition & 0 deletions src/modules/quote/dtos/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './create-quote.dto';
4 changes: 4 additions & 0 deletions src/modules/quote/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dtos';
export * from './quote.controller';
export * from './quote.module';
export * from './quote.service';
6 changes: 6 additions & 0 deletions src/modules/quote/quote.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Controller } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('quote')
@Controller('quote')
export class QuoteController {}
10 changes: 10 additions & 0 deletions src/modules/quote/quote.module.ts
Original file line number Diff line number Diff line change
@@ -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 {}
4 changes: 4 additions & 0 deletions src/modules/quote/quote.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';

@Injectable()
export class QuoteService {}

0 comments on commit b713199

Please sign in to comment.