CommentsController.java 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package thyyxxk.webserver.controller.outpatient.comments;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.web.bind.annotation.*;
  4. import thyyxxk.webserver.entity.ResultVo;
  5. import thyyxxk.webserver.entity.outpatient.comments.request.CommentInquiry;
  6. import thyyxxk.webserver.entity.outpatient.comments.response.CommentsResponse;
  7. import thyyxxk.webserver.service.outpatient.comments.CommentsService;
  8. @RestController
  9. @RequestMapping("/comments")
  10. public class CommentsController {
  11. private final CommentsService service;
  12. @Autowired
  13. public CommentsController(CommentsService service) {
  14. this.service = service;
  15. }
  16. @PostMapping("/getComments")
  17. public ResultVo<CommentsResponse> getComments(@RequestBody CommentInquiry inquiry) {
  18. return service.getComments(inquiry);
  19. }
  20. @GetMapping("/updateCommentStatus")
  21. public ResultVo<String> updateCommentStatus(@RequestParam("id") int id,
  22. @RequestParam("deleted") int deleted) {
  23. return service.updateCommentStatus(id, deleted);
  24. }
  25. }