package com.zhujizheng.IHome.generator.dao; import lombok.Data; import lombok.extern.slf4j.Slf4j; import java.util.Date; @Data @Slf4j public class PYMsgNotify { private Integer id; private Integer userId; // 消息类型,1聊天消息,2对方向自己发起好友申请,3自己向对方发起好友申请 private Integer msgType; // 消息类型对应的id private Integer msgTypeId; // 角标数 private Integer msgNum; private Long msgTime; private String msgDesc; // 扩展字段,是否置顶等数据 private String msgExt; private Date createTime; private Date updateTime; private String createUser; private String updateUser; private Boolean isDelete; public static PYMsgNotify createChatMsgNotify(Integer userId, Integer msgTypeId, String msgDesc, Long msgTime) { PYMsgNotify msgNotify = new PYMsgNotify(); msgNotify.setUserId(userId); msgNotify.setMsgType(1); msgNotify.setMsgTypeId(msgTypeId); msgNotify.setMsgTime(msgTime); msgNotify.setMsgDesc(msgDesc); msgNotify.setMsgNum(1); msgNotify.setMsgExt(""); log.info("createChatMsgNotify msgNotify = " + msgNotify); return msgNotify; } public static PYMsgNotify createApplyMsgNotify(Integer userId, Integer msgTypeId, String msgDesc, String msgExt) { PYMsgNotify msgNotify = new PYMsgNotify(); msgNotify.setUserId(userId); msgNotify.setMsgType(2); msgNotify.setMsgTypeId(msgTypeId); msgNotify.setMsgNum(1); msgNotify.setMsgTime(System.currentTimeMillis()); msgNotify.setMsgDesc(msgDesc); msgNotify.setMsgExt(msgExt); log.info("createApplyMsgNotify msgNotify = " + msgNotify); return msgNotify; } }