系统消息代码接口优化修改

Signed-off-by: liuhanqing <447067298@qq.com>
pull/65/head
liuhanqing 4 years ago
parent 1826a11499
commit 608bca4ca5

@ -9,7 +9,7 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleUserInfo;
import cn.stylefeng.roses.kernel.menu.modular.service.SysMenuService;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.api.pojo.request.MessageRequest;
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrganization;
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrOrganizationService;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
@ -69,9 +69,9 @@ public class IndexService {
renderMap.put("wsUrl", loginUser.getWsUrl());
// 未读消息数量
MessageParam messageParam = new MessageParam();
messageParam.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
renderMap.put("msgUnReadCount", messageApi.queryCountCurrentUser(messageParam));
MessageRequest messageRequest = new MessageRequest();
messageRequest.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
renderMap.put("msgUnReadCount", messageApi.queryCountCurrentUser(messageRequest));
return renderMap;
}

@ -2,8 +2,8 @@ package cn.stylefeng.guns.modular.system.message;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageResponse;
import cn.stylefeng.roses.kernel.message.api.pojo.request.MessageRequest;
import cn.stylefeng.roses.kernel.message.api.pojo.response.MessageResponse;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import org.springframework.stereotype.Controller;
@ -33,10 +33,10 @@ public class MessageViewController {
*/
@GetResource(name = "系统消息界面", path = "/view/message", requiredPermission = false)
public String message(Model model) {
MessageParam messageParam = new MessageParam();
messageParam.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
Integer messageCount = messageApi.queryCountCurrentUser(messageParam);
List<MessageResponse> messageList = messageApi.queryListCurrentUser(messageParam);
MessageRequest messageRequest = new MessageRequest();
messageRequest.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
Integer messageCount = messageApi.queryCountCurrentUser(messageRequest);
List<MessageResponse> messageList = messageApi.queryListCurrentUser(messageRequest);
model.addAttribute("msgUnReadCount", messageCount);
model.addAttribute("msgUnReadList", messageList);
return "/modular/system/index/message.html";

Loading…
Cancel
Save