docs: complete swagger annotations for auth, home, blogs and wiki endpoints
This commit is contained in:
1 parent
e09adc03c3
commit
24137beb32
4 files changed
+39
-3
No files matched your search
@@ -1,16 +1,27 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { Controller, Get, Param, HttpStatus } from '@nestjs/common';
|
||||
import { WikiService } from './wiki.service';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiOkResponse, ApiNotFoundResponse } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('Wiki - دانشنامه ترکیبات')
|
||||
@Controller('wiki')
|
||||
@ApiResponse({
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
description: 'خطای داخلی سرور'
|
||||
})
|
||||
export class WikiController {
|
||||
constructor(private readonly wikiService: WikiService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'دریافت تمام کلمات دانشنامه' })
|
||||
@ApiOkResponse({ description: 'لیست تمامی ترکیبات علمی' })
|
||||
findAll() {
|
||||
return this.wikiService.findAll();
|
||||
}
|
||||
|
||||
@Get(':key')
|
||||
@ApiOperation({ summary: 'دریافت ترکیب علمی با کلید' })
|
||||
@ApiOkResponse({ description: 'اطلاعات کامل ترکیب علمی' })
|
||||
@ApiNotFoundResponse({ description: 'ترکیب علمی یافت نشد' })
|
||||
findOne(@Param('key') key: string) {
|
||||
return this.wikiService.findOneByKey(key);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user