package net.tccn.redim.entity;

import lombok.Getter;
import lombok.Setter;
import org.redkale.convert.json.JsonConvert;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author lxyer
 */
@Setter
@Getter
@Table(catalog = "redbbs", name = "im_msgrecord", comment = "[聊天记录表]")
public class MsgRecord implements java.io.Serializable {

    @Id
    @Column(comment = "[主键id]")
    private int msgid;

    @Column(comment = "[发送人]")
    private int fromuserid;

    @Column(comment = "[接收人]")
    private int touserid;

    @Column(comment = "[内容]")
    private String content = "";

    @Column(updatable = false, comment = "[发送时间]")
    private long createtime = System.currentTimeMillis();

    @Column(comment = "[状态]-10删除，10未发送 20已发送 30已读")
    private short status = 10;

    @Override
    public String toString() {
        return JsonConvert.root().convertTo(this);
    }
}
