ChatRecord.java 1010 Bytes
package cn.fw.hermes.domain.db;

import cn.fw.common.data.entity.BaseEntity;
import lombok.Data;

import java.util.Date;

/**
 * 聊天记录
 *
 * @Author: liwei
 * @Date: 2018/12/10 16:05
 */
@Data
public class ChatRecord extends BaseEntity<ChatRecord, Long> {
    /**
     * 消息发送者
     */
    private String fromAccount;

    /**
     * 消息接收者
     */
    private String toAccount;

    /**
     * 发送时间
     */
    private Date sendTime;

    /**
     * 消息内容
     */
    private String content;

    public static ChatRecord create(String fromAccount,
                                    String toAccount,
                                    Date sendTime,
                                    String content) {
        ChatRecord chatRecord = new ChatRecord();
        chatRecord.setFromAccount(fromAccount);
        chatRecord.setToAccount(toAccount);
        chatRecord.setSendTime(sendTime);
        chatRecord.setContent(content);
        return chatRecord;

    }

}