package com.yihu.jw.entity.base.message;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.util.Date;


/**
 * 消息表实体
 *
 * @author litaohong on  2018年09月14日
 */
@Entity
@Table(name = "base_message")
@SequenceGenerator(name="id_generated", sequenceName="BASE_MESSAGE_SEQ")
public class BaseMessageDO extends IntegerIdentityEntity {


    /**
     * 消息接收人（微信平台为患者标识，医生APP平台为医生标识）
     */
    private String receiver;

    /**
     * 接收人姓名
     */
    private String receiverName;

    /**
     * 消息发送人标识
     */
    private String sender;

    /**
     * 发送人姓名
     */
    private String senderName;

    /**
     * 发送者头像
     */
    private String senderPhoto;

    /**
     * 消息标题
     */
    private String title;

    /**
     * 消息摘要
     */
    private String msgDigest;

    /**
     * 消息内容，存json
     */
    private String msgContent;

    /**
     * 消息类型查base_message_type
     */
    private String msgTypeCode;

    private String msgTypeName;

    /**
     * 消息平台，1微信端/患者端，2医生APP端
     */
    private Integer platform;

    /**
     * 阅读状态，1 已读，0未读
     */
    private Integer readState;

    /**
     * 只读消息：1否，0是
     */
    private Integer readonly;

    /**
     * 是否删除，1正常，0作废
     */
    private String del;

    /**
     * im会话id
     */
    private String sessionId;

    /**
     * im会话名称
     */
    private String sessionName;

    /**
     * 消息发送时间
     */
    private Date createTime;

    /**
     * 消息阅读时间
     */

    private Date readTime;

    /**
     * 关联其他业务的信息json格式
     */
    private String relationData;

    @Column(name = "receiver")
    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    @Column(name = "receiver_name")
    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    @Column(name = "sender")
    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    @Column(name = "sender_name")
    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    @Column(name = "sender_photo")
    public String getSenderPhoto() {
        return senderPhoto;
    }

    public void setSenderPhoto(String senderPhoto) {
        this.senderPhoto = senderPhoto;
    }

    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "msg_digest")
    public String getMsgDigest() {
        return msgDigest;
    }

    public void setMsgDigest(String msgDigest) {
        this.msgDigest = msgDigest;
    }

    @Column(name = "msg_content")
    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    @Column(name = "msg_type_code")
    public String getMsgTypeCode() {
        return msgTypeCode;
    }

    public void setMsgTypeCode(String msgTypeCode) {
        this.msgTypeCode = msgTypeCode;
    }

    @Column(name = "msg_type_name")
    public String getMsgTypeName() {
        return msgTypeName;
    }

    public void setMsgTypeName(String msgTypeName) {
        this.msgTypeName = msgTypeName;
    }

    @Column(name = "platform")
    public Integer getPlatform() {
        return platform;
    }

    public void setPlatform(Integer platform) {
        this.platform = platform;
    }

    @Column(name = "read_state")
    public Integer getReadState() {
        return readState;
    }

    public void setReadState(Integer readState) {
        this.readState = readState;
    }

    @Column(name = "readonly")
    public Integer getReadonly() {
        return readonly;
    }

    public void setReadonly(Integer readonly) {
        this.readonly = readonly;
    }

    @Column(name = "del")
    public String getDel() {
        return del;
    }

    public void setDel(String del) {
        this.del = del;
    }

    @Column(name = "session_id")
    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    @Column(name = "session_name")
    public String getSessionName() {
        return sessionName;
    }

    public void setSessionName(String sessionName) {
        this.sessionName = sessionName;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "read_time")
    public Date getReadTime() {
        return readTime;
    }

    public void setReadTime(Date readTime) {
        this.readTime = readTime;
    }

    @Column(name = "relation_data")
    public String getRelationData() {
        return relationData;
    }

    public void setRelationData(String relationData) {
        this.relationData = relationData;
    }

}