package com.njcn.msgpush.module.push.controller.admin.channel.vo;

import com.njcn.msgpush.framework.common.pojo.PageParam;
import com.njcn.msgpush.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

@Data
@Schema(description = "管理后台 - 渠道服务商配置 Request VO")
public class ChannelProviderConfigReqVO extends PageParam {
    @Schema(description = "渠道ID")
    private String id;

    @Schema(description = "渠道类型：sms/email/app", example = "sms")
    @InEnum(value = com.njcn.msgpush.module.push.enums.ChannelTypeEnum.class, message = "渠道类型必须是 {value}")
    private String channel;

    @Schema(description = "服务商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "中国电信/阿里云/UniPush")
    @NotBlank(message = "服务商名称不能为空")
    private String providerName;

    @Schema(description = "服务商类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "telecom/cmcc/aliyun/twilio/unipush")
    @InEnum(value = com.njcn.msgpush.module.push.enums.ProviderTypeEnum.class, message = "服务商类型必须是 {value}")
    private String providerType;

    @Schema(description = "API地址")
    @NotBlank(message = "API地址不能为空")
    private String apiUrl;

    @Schema(description = "AppKey")
    @NotBlank(message = "AppKey不能为空")
    private String appKey;

    @Schema(description = "AppSecret")
    @NotBlank(message = "AppSecret不能为空")
    private String appSecret;

    @Schema(description = "额外配置（JSON格式）", example = "{}")
    private String extraConfig;

    @Schema(description = "优先级（数字越小优先级越高）", example = "1")
    @Min(value = 1L, message = "优先级不能小于 1")
    private Integer priority;
}
