123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.ym.mec.web.controller;
- import com.ym.mec.auth.api.client.SysUserFeignService;
- import com.ym.mec.auth.api.entity.SysUser;
- import com.ym.mec.biz.dal.entity.ChargeType;
- import com.ym.mec.biz.dal.entity.SysMessage;
- import com.ym.mec.biz.service.ChargeTypeService;
- import com.ym.mec.biz.service.SysMessageService;
- import com.ym.mec.common.controller.BaseController;
- import com.ym.mec.common.page.QueryInfo;
- import com.ym.mec.common.security.SecurityUtils;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Date;
- @RequestMapping("message")
- @Api(tags = "消息提醒服务")
- @RestController
- public class SysMessageController extends BaseController {
- @Autowired
- private SysMessageService sysMessageService;
- @Autowired
- private SysUserFeignService sysUserFeignService;
- @ApiOperation(value = "新增消息提醒")
- @PostMapping("/add")
- public Object add(SysMessage sysMessage) {
- sysMessageService.insert(sysMessage);
- return succeed();
- }
- @ApiOperation(value = "删除消息提醒")
- @PostMapping("/del/{id}")
- @ApiParam(value = "消息提醒编号", required = true)
- public Object del( @PathVariable("id") Long id) {
- sysMessageService.delete(id);
- return succeed();
- }
- @ApiOperation(value = "修改消息提醒")
- @PostMapping("/update")
- public Object update(SysMessage sysMessage) {
- sysMessageService.update(sysMessage);
- return succeed();
- }
- @ApiOperation(value = "获取用户未读消息条数")
- @PostMapping("/findNewMessageNum")
- public Object findNewMessageNum(){
- SysUser sysUser = sysUserFeignService.queryUserInfo();
- if(sysUser == null){
- return failed("请重新登录");
- }
- return succeed(sysMessageService.findNewMessageNum(sysUser.getId()));
- }
- @ApiOperation(value = "分页查询消息提醒列表")
- @GetMapping("/queryPage")
- public Object queryPage(QueryInfo queryInfo) {
- return succeed(sysMessageService.queryPage(queryInfo));
- }
- }
|