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 { BlogsService } from './blogs.service';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiOkResponse, ApiNotFoundResponse } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('Blogs - مجله سلامت')
|
||||
@Controller('blogs')
|
||||
@ApiResponse({
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
description: 'خطای داخلی سرور'
|
||||
})
|
||||
export class BlogsController {
|
||||
constructor(private readonly blogsService: BlogsService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'دریافت لیست مقالات مجله سلامت' })
|
||||
@ApiOkResponse({ description: 'لیست مقالات منتشر شده' })
|
||||
findAll() {
|
||||
return this.blogsService.findAll();
|
||||
}
|
||||
|
||||
@Get(':slug')
|
||||
@ApiOperation({ summary: 'دریافت مقاله با اسلاگ (Slug)' })
|
||||
@ApiOkResponse({ description: 'اطلاعات کامل مقاله' })
|
||||
@ApiNotFoundResponse({ description: 'مقاله یافت نشد' })
|
||||
findOne(@Param('slug') slug: string) {
|
||||
return this.blogsService.findOneBySlug(slug);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user