package com.tenlionsoft.baselib.core.beans;

import java.io.Serializable;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

/**
 * 作者: adam
 * 日期: 1/11/21 - 9:53 AM
 * 邮箱: itgaojian@163.com
 * 描述:
 */
@Entity(tableName = "db_msg")
public class MessageBean implements Serializable {

    /**
     * id
     */
    @NonNull
    @PrimaryKey
    private String id;
    /**
     * 消息类型
     */
    @ColumnInfo(name = "type")
    private Integer type;
    /**
     * 是否为系统消息
     */
    @ColumnInfo(name = "isSystem")
    private Boolean isSystem;
    /**
     * 来源，系统消息为：SYSTEM，非系统消息为 userId
     */
    @ColumnInfo(name = "from")
    private String from;
    /**
     * 去处，系统消息为 appId, 非系统消息为 userId
     */
    @ColumnInfo(name = "to")
    private String to;
    /**
     * 消息体
     */
    @ColumnInfo(name = "body")
    private String body;
    /**
     * 时间戳
     */
    @ColumnInfo(name = "timestamp")
    private long timestamp;

    /**
     * 发送状态
     * 11  //发送中
     * 12  //发送失败
     * 13  //发送成功
     */
    @ColumnInfo(name = "sendState")
    private int sendState;

    @ColumnInfo(name = "fromName")
    private String fromName;
    /**
     * 信息类型
     * <p>
     * 110 我发给其他人的文本信息
     * 111 其他人发送给我的文本信息
     * <p>
     * 121 我发送给其他人语音信息
     * 122 其他人发送给我的语音信息
     * <p>
     * 131 我发给其他人的图片信息
     * 132 其他人发送给我的图片信息
     * <p>
     * 141 我发送给其他人的视频信息
     * 142 其他人发送给我的视频信息
     * <p>
     * 151 我发送给其他人的文件信息
     * 152 其他人发送给我的文件信息
     */
    @ColumnInfo(name = "msgType")
    private int msgType;

    @Ignore
    private long msgWhat;

    public long getMsgWhat() {
        return msgWhat;
    }

    public void setMsgWhat(long msgWhat) {
        this.msgWhat = msgWhat;
    }

    public int getSendState() {
        return sendState;
    }

    public void setSendState(int sendState) {
        this.sendState = sendState;
    }

    public int getMsgType() {
        return msgType;
    }

    public void setMsgType(int msgType) {
        this.msgType = msgType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public String getFromName() {
        return fromName;
    }

    public void setFromName(String fromName) {
        this.fromName = fromName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getSystem() {
        return isSystem;
    }

    public void setSystem(Boolean system) {
        isSystem = system;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }
}
