| 123456789101112131415161718192021222324252627282930 |
- import {
- Controller,
- Put,
- Body,
- Post
- } from '@nestjs/common'
- import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'
- import { CommentService } from './comment.service'
- import { Comment } from './entities/comment.entity'
- import { PageRequest } from 'src/common/dto/page-request'
- import { CommentDto } from './dto/comment.dto'
- @ApiTags('comment')
- @Controller('/comment')
- @ApiBearerAuth()
- export class CommentController {
- constructor(private readonly commentService: CommentService) { }
- @Post()
- public async list(@Body() page: PageRequest<Comment>) {
- return await this.commentService.findAll(page)
- }
- @Put()
- public async create(@Body() commentDto: CommentDto) {
- return await this.commentService.create(commentDto)
- }
- }
|