package com.sikey.wa04.business.domain.entity.message;

import com.sikey.wa04.common.enums.MessageType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.Instant;
import java.util.List;

/**
 * 消息
 *
 * @author luoyangwei
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ToString
public class Message {

    /**
     * 消息ID
     */
    private MessageId id;

    /**
     * 消息类型
     */
    private MessageType type;

    /**
     * 消息类容
     */
    private Object content;

    /**
     * 消息发送人
     */
    private String senderId;

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

    /**
     * 是否是群聊消息
     */
    private boolean isGroup;
    /**
     * 群聊消息时这里会有ID
     */
    private String groupId;

    /**
     * 消息读取记录
     */
    private List<MessageReceivedLog> receivedLogs;

    /**
     * 消息读取人列表
     */
    private List<String> receiverId;

    /**
     * ack id
     */
    private Long ackId;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

}
