package com.sikey.wa04.business.infrastructure.dto.response.messaging;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class HistoryUnreadMessageResponse implements Serializable {
    @Serial
    private static final long serialVersionUID = -4789236223186362833L;

    /**
     * 剩余的未读消息数
     */
    private Integer unreadMsgCount;

    /**
     * 未读消息的列表
     */
    private List<HistoryUnreadMessageResult> msgs;

    @Data
    @Accessors(chain = true)
    @EqualsAndHashCode(callSuper = false)
    public static class HistoryUnreadMessageResult implements Serializable {
        @Serial
        private static final long serialVersionUID = 5546415629516194540L;

        /**
         * 消息类型
         *
         * @see com.sikey.wa04.common.enums.MessageType
         */
        private Integer msgType;

        /**
         * 消息ID
         */
        private Long msgId;

        /**
         * 接收消息用户
         */
        private String recvId;

        /**
         * 发送消息用户
         */
        private String sendId;

        /**
         * 消息发送时间
         */
        private Long sendTime;

        /**
         * 接收人是否是群聊
         */
        private Boolean isGroup;

        /**
         * 群组id
         */
        private String groupId;

        /**
         * 消息内容
         *
         * @see com.sikey.wa04.common.dto.message.ChatTextMessage.ChatTextContent 文本消息
         * @see com.sikey.wa04.common.dto.message.ChatVideoMessage.ChatVideoContent 视频消息
         * @see com.sikey.wa04.common.dto.message.ChatVoiceMessage.ChatVoiceContent 语音消息
         * @see com.sikey.wa04.common.dto.message.ChatEmojiMessage.ChatEmojiContent 表情消息
         * @see com.sikey.wa04.common.dto.message.ChatImageMessage.ChatImageContent 图片消息
         */
        private Map<String, Object> content;
    }
}
