comment.controller.ts 735 B

12345678910111213141516171819202122232425262728293031
  1. import {
  2. Controller,
  3. Put,
  4. Get,
  5. Body,
  6. Param,
  7. HttpStatus,
  8. NotFoundException,
  9. Delete,
  10. BadRequestException,
  11. Req,
  12. Post
  13. } from '@nestjs/common'
  14. import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'
  15. import { CommentService } from './comment.service'
  16. import { Comment } from './entities/comment.entity'
  17. import { PageRequest } from 'src/common/dto/page-request'
  18. @ApiTags('comment')
  19. @Controller('/comment')
  20. @ApiBearerAuth()
  21. export class CommentController {
  22. constructor(private readonly commentService: CommentService) { }
  23. @Post('/:id')
  24. public async list(@Body() page: PageRequest<Comment>, @Param('id') id: number) {
  25. return await this.commentService.findAll(page,id)
  26. }
  27. }