| | |
| | | package com.mindskip.xzs.controller.student; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.mindskip.xzs.base.BaseApiController; |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.Feedback; |
| | | import com.mindskip.xzs.domain.vo.FeedbackVO; |
| | | import com.mindskip.xzs.service.FeedbackService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author gonghl |
| | |
| | | */ |
| | | |
| | | @RequiredArgsConstructor |
| | | @RestController("adminFeedBackController") |
| | | @RequestMapping("/api/admin/feedback") |
| | | @RestController("StudentFeedBackController") |
| | | @RequestMapping("/api/student/feedback") |
| | | public class FeedBackController extends BaseApiController { |
| | | |
| | | private final FeedbackService feedbackService; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * 保存反馈 |
| | | * |
| | | * @param feedbackVO 数据 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("page") |
| | | public RestResponse<PageInfo<FeedbackVO>> page(@RequestBody FeedbackVO feedbackVO) { |
| | | return RestResponse.ok(feedbackService.feedbackPage(feedbackVO)); |
| | | } |
| | | |
| | | /** |
| | | * 删除反馈 |
| | | */ |
| | | @PostMapping("delete/{id}") |
| | | public RestResponse<String> delete(@PathVariable Integer id) { |
| | | feedbackService.removeById(id); |
| | | return RestResponse.ok("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 处理反馈 |
| | | */ |
| | | @PostMapping("settleFeedback/{id}") |
| | | public RestResponse<String> settleFeedback(@PathVariable Integer id) { |
| | | feedbackService.settleFeedback(id); |
| | | @PostMapping("saveFeedback") |
| | | public RestResponse<String> saveFeedback(@RequestBody FeedbackVO feedbackVO) { |
| | | feedbackVO.setUserId(getCurrentUser().getId()); |
| | | feedbackService.saveFeedback(feedbackVO); |
| | | return RestResponse.ok("操作成功"); |
| | | } |
| | | |