package com.snack.server.module.chat.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 客服消息 VO（HTTP 出参 / WebSocket 推送统一格式）
 */
@Data
@Schema(description = "客服消息")
public class ChatMessageVO implements Serializable {

    @Schema(description = "消息 ID")
    private Long id;

    @Schema(description = "会话 ID")
    private Long sessionId;

    @Schema(description = "会话内递增序号")
    private Long seq;

    @Schema(description = "发送者 ID")
    private Long senderId;

    @Schema(description = "发送者类型：0-用户 1-客服 2-系统")
    private Integer senderType;

    @Schema(description = "消息类型：text / image / file / product / system")
    private String type;

    @Schema(description = "消息内容")
    private String content;

    @Schema(description = "扩展字段 JSON")
    private String extra;

    @Schema(description = "是否撤回：0-否 1-是")
    private Integer isRecalled;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "发送时间")
    private LocalDateTime createTime;
}
