package com.yingyangfly.app.controller; import com.yingyangfly.common.dto.ResultResponse; import com.yingyangfly.common.log.annotation.TraceLog; import com.yingyangfly.core.annotation.Log; import com.yingyangfly.core.domain.GameParamsUser; import com.yingyangfly.core.domain.MsgWarn; import com.yingyangfly.core.enums.OperatorType; import com.yingyangfly.core.service.MsgWarnService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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; import java.util.List; /** * 消息提醒 * * @author jiangqian * @date 2023/8/17 0017 15:59 */ @RestController @RequestMapping("/app/warn") @Api(tags = "消息提醒") public class MsgWarnController { @Autowired private MsgWarnService msgWarnService; /** * 列表 * @return */ @Log(title = "消息列表",operatorType = OperatorType.MOBILE) @ApiOperation("获取推送消息列表") @PostMapping("/list") @TraceLog public ResultResponse selectAll(@RequestBody MsgWarn msgWarn) { return ResultResponse.success(msgWarnService.page(msgWarn)); } /** * 查询有多少未读消息 * @return */ // @Log(title = "查询有多少未读消息",operatorType = OperatorType.MOBILE) @ApiOperation("获取未读消息数量") @PostMapping("/countMyMsg") @TraceLog public ResultResponse countMyMsg() { return ResultResponse.success(msgWarnService.countMyMsg()); } /** * 修改未读消息为已读消息 * @return */ @Log(title = "更改消息状态",operatorType = OperatorType.MOBILE) @ApiOperation("更改消息状态") @PostMapping("/readMsg") @TraceLog public ResultResponse readMsg(Long msgId) { msgWarnService.readMsg(msgId); return ResultResponse.success(); } /** * 查询首页未读消息 * @return */ // @Log(title = "查询首页未读消息",operatorType = OperatorType.MOBILE) @PostMapping("/selectHomePageMsg") @TraceLog public ResultResponse selectHomePageMsg(String msgType) { return ResultResponse.success(msgWarnService.selectHomePageMsg(msgType)); } }