
/**
 *
 */
package org.tio.sitexxx.im.common.bs.wx.sys;

import lombok.Data;
import org.tio.sitexxx.service.model.main.WxChatItems;
import org.tio.sitexxx.service.model.main.WxFriendMsg;

import java.io.Serializable;

/**
 * 用户系统通知-- Server-->Client
 * @author xufei
 * 2020年2月19日 下午2:56:14
 */
@Data
public class WxUserSysNtf implements Serializable {
	private static final long	serialVersionUID	= 4487525418584644680L;
	private Long				mid;										//消息id，全局唯一，一条消息一个id
	private Long				t;											//消息发送时间
	private String				c;											//聊天内容
	private Integer				uid;										//发送方的userid
	private Short				code;										//操作码：30:好友申请

	private String bizdata; //业务数据

	private String fiddata; //好友业务数据

	private WxChatItems chatItems;

	public static WxUserSysNtf from(WxFriendMsg wxFriendMsg) {
		WxUserSysNtf ret = new WxUserSysNtf();
		ret.setC(wxFriendMsg.getText());
		ret.setMid(wxFriendMsg.getId());
		ret.setT(wxFriendMsg.getTime().getTime());
		ret.setUid(wxFriendMsg.getUid());
		return ret;
	}
}
