MsgWarnController.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package com.yingyangfly.app.controller;
  2. import com.yingyangfly.common.dto.ResultResponse;
  3. import com.yingyangfly.common.log.annotation.TraceLog;
  4. import com.yingyangfly.core.annotation.Log;
  5. import com.yingyangfly.core.domain.GameParamsUser;
  6. import com.yingyangfly.core.domain.MsgWarn;
  7. import com.yingyangfly.core.enums.OperatorType;
  8. import com.yingyangfly.core.service.MsgWarnService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.PostMapping;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import java.util.List;
  17. /**
  18. * 消息提醒
  19. *
  20. * @author jiangqian
  21. * @date 2023/8/17 0017 15:59
  22. */
  23. @RestController
  24. @RequestMapping("/app/warn")
  25. @Api(tags = "消息提醒")
  26. public class MsgWarnController {
  27. @Autowired
  28. private MsgWarnService msgWarnService;
  29. /**
  30. * 列表
  31. * @return
  32. */
  33. @Log(title = "消息列表",operatorType = OperatorType.MOBILE)
  34. @ApiOperation("获取推送消息列表")
  35. @PostMapping("/list")
  36. @TraceLog
  37. public ResultResponse selectAll(@RequestBody MsgWarn msgWarn) {
  38. return ResultResponse.success(msgWarnService.page(msgWarn));
  39. }
  40. /**
  41. * 查询有多少未读消息
  42. * @return
  43. */
  44. // @Log(title = "查询有多少未读消息",operatorType = OperatorType.MOBILE)
  45. @ApiOperation("获取未读消息数量")
  46. @PostMapping("/countMyMsg")
  47. @TraceLog
  48. public ResultResponse countMyMsg() {
  49. return ResultResponse.success(msgWarnService.countMyMsg());
  50. }
  51. /**
  52. * 修改未读消息为已读消息
  53. * @return
  54. */
  55. @Log(title = "更改消息状态",operatorType = OperatorType.MOBILE)
  56. @ApiOperation("更改消息状态")
  57. @PostMapping("/readMsg")
  58. @TraceLog
  59. public ResultResponse readMsg(Long msgId) {
  60. msgWarnService.readMsg(msgId);
  61. return ResultResponse.success();
  62. }
  63. /**
  64. * 查询首页未读消息
  65. * @return
  66. */
  67. // @Log(title = "查询首页未读消息",operatorType = OperatorType.MOBILE)
  68. @PostMapping("/selectHomePageMsg")
  69. @TraceLog
  70. public ResultResponse selectHomePageMsg(String msgType) {
  71. return ResultResponse.success(msgWarnService.selectHomePageMsg(msgType));
  72. }
  73. }