package com.snack.server.module.chat.dto.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serializable;

/**
 * 发送消息请求（HTTP 兜底，WebSocket 也能用同一结构）
 */
@Data
@Schema(description = "客服发送消息请求")
public class ChatSendMessageReq implements Serializable {

    @NotNull(message = "会话 ID 不能为空")
    @Schema(description = "会话 ID", example = "1")
    private Long sessionId;

    @NotBlank(message = "消息类型不能为空")
    @Schema(description = "消息类型：text / image / file / product", example = "text")
    private String type;

    @NotBlank(message = "消息内容不能为空")
    @Size(max = 4000, message = "消息内容过长")
    @Schema(description = "消息内容（文字或 URL）")
    private String content;

    @Schema(description = "扩展字段（商品卡片 JSON 等）")
    private String extra;

    /** 客户端消息 ID（用于去重和 ACK），可选 */
    @Schema(description = "客户端消息 ID（幂等 / ACK）")
    private String clientMsgId;
}
