package cn.wzpmc.pojo;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.*;
import top.xinsin.enums.MessageTypes;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author wzp
 * Created On 2022/5/14
 * @version 1.0
 */
@Data
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
public class Message {
    private int id;
    private String content;
    private String sender;
    private int recall;
    @JSONField(format =  "yyyy-MM-dd HH:mm:ss")
    private Date sendtime;
    private String base64;
    private MessageTypes type;
    public Message(String content, String sender,String type){
        this.content = content;
        this.sender = sender;
        this.type = MessageTypes.valueOf(type);
        this.sendtime = new Date();
    }
}

