package com.xindazhou.message.api.dto.send;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.Map;

/**
 * 消息发送 Request DTO
 *
 * @author xindazhou
 */
@Schema(description = "RPC 服务 - 消息发送 Request DTO")
@Data
public class MessageSendReqDTO {

    @Schema(description = "用户编号", example = "1024")
    private Long userId;

    @Schema(description = "用户类型：1-会员用户(MEMBER), 2-管理员用户(ADMIN)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1", 
            allowableValues = {"1", "2"})
    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @Schema(description = "消息类型：SMS-短信, PUSH-推送, NOTIFY-站内信, EMAIL-邮件", requiredMode = Schema.RequiredMode.REQUIRED, example = "SMS",
            allowableValues = {"SMS", "PUSH", "NOTIFY", "EMAIL"})
    @NotEmpty(message = "消息类型不能为空")
    private String messageType;

    @Schema(description = "消息模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "MESSAGE_TEMPLATE_001")
    @NotEmpty(message = "消息模板编号不能为空")
    private String templateCode;

    @Schema(description = "消息模板参数")
    private Map<String, Object> templateParams;

    @Schema(description = "接收者（手机号/邮箱等，可选，为空时使用 userId）", example = "15601691300")
    private String receiver;

    @Schema(description = "标题（站内信、邮件使用）", example = "系统通知")
    private String title;

    @Schema(description = "内容（站内信、邮件使用，为空时使用模板）")
    private String content;

}

