package com.zhujizheng.IHome.msgnotify.vo;

import com.zhujizheng.IHome.generator.dao.PYMsgNotify;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Data
@Slf4j
public class PYMsgNotifyVO {
    private Integer notifyId;
    private Integer userId;
    private Long msgTime;
    // 消息类型,1聊天消息,2好友申请,3生日通知
    private Integer msgType;
    // 角标数
    private Integer msgNum;
    // 消息类型对应的id
    private Integer msgTypeId;
    private String msgDesc;
    // 扩展字段,是否置顶等数据
    private String msgExt;

    public static PYMsgNotifyVO createVO(PYMsgNotify msgNotify) {
        log.info("msgNotify = " + msgNotify);
        PYMsgNotifyVO vo = new PYMsgNotifyVO();
        vo.setNotifyId(msgNotify.getId());
        vo.setUserId(msgNotify.getUserId());
        vo.setMsgType(msgNotify.getMsgType());
        vo.setMsgTypeId(msgNotify.getMsgTypeId());
        vo.setMsgNum(msgNotify.getMsgNum());
        vo.setMsgTime(msgNotify.getMsgTime());
        vo.setMsgDesc(msgNotify.getMsgDesc());
        vo.setMsgExt(msgNotify.getMsgExt());
        log.info("vo = " +  vo);
        return vo;
    }
}