| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2024-06-17 19:19:20 |
| 4 | * @LastEditTime: 2024-12-23 12:45:22 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: 反馈 |
| 7 | */ |
| 8 | import { Controller, Get, Param, Query } from '@nestjs/common'; |
| 9 | import { ApiOperation } from '@nestjs/swagger'; |
| 10 | import { ParamsValidationPipe } from 'src/validation.pipe'; |
| 11 | import { FeedbackService } from './feedback.service'; |
| 12 | import { UserService } from 'src/user/user.service'; |
| 13 | import { Manager } from 'src/auth/manager.guard'; |
| 14 | import { TableDto } from 'src/global/dto/table.dto'; |
| 15 | import { GetFeedbackListDto } from './dto/feedback.dto'; |
| 16 | |
| 17 | @Manager() |
| 18 | @Controller('admin/feedback') |
| 19 | export class FeedbackAdminController { |
| 20 | constructor( |
| 21 | private readonly feedbackService: FeedbackService, |
| 22 | private readonly userService: UserService, |
| 23 | ) {} |
| 24 | |
| 25 | @ApiOperation({ |
| 26 | description: '反馈列表', |
| 27 | summary: '反馈列表', |
| 28 | }) |
| 29 | @Get('list/:pageNo/:pageSize') |
| 30 | async getList( |
| 31 | @Param(new ParamsValidationPipe()) param: TableDto, |
| 32 | @Query(new ParamsValidationPipe()) query: GetFeedbackListDto, |
| 33 | ) { |
| 34 | const res = await this.feedbackService.getFeedbackList(param, query); |
| 35 | return res; |
| 36 | } |
| 37 | |
| 38 | @ApiOperation({ |
| 39 | description: '反馈详情', |
| 40 | summary: '反馈详情', |
| 41 | }) |
| 42 | @Get('info/:id') |
| 43 | async getInfo(@Param('id') id: string) { |
| 44 | const res = await this.feedbackService.getFeedbackInfo(id); |
| 45 | return res; |
| 46 | } |
| 47 | |
| 48 | @ApiOperation({ |
| 49 | description: '删除反馈', |
| 50 | summary: '删除反馈', |
| 51 | }) |
| 52 | @Get('del/:id') |
| 53 | async delFeedback(@Param('id') id: string) { |
| 54 | const res = await this.feedbackService.delFeedback(id); |
| 55 | return res; |
| 56 | } |
| 57 | } |
| 58 |