package com.cf.imes.module.system.controller.admin.sms.vo.template;

import com.cf.imes.module.system.validation.common.CommonStatus;
import com.cf.imes.module.system.validation.sms.SmsTemplateTypeValid;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;

@Schema(description = "管理后台 - 短信模板创建/修改 Request VO")
@Data
public class SmsTemplateSaveReqVO {

    @Schema(description = "编号", example = "1024")
    private Long id;

    @Schema(description = "短信类型，参见 SmsTemplateTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "短信类型不能为空")
    @SmsTemplateTypeValid
    private Integer type;

    @Schema(description = "开启状态，参见 CommonStatusEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "开启状态不能为空")
    @CommonStatus
    private Integer status;

    @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "test_01")
    @NotNull(message = "模板编码不能为空")
    @Length(min = 1, max = 64, message = "模板编码长度不能超过64个字符")
    private String code;

    @Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "chenfeng")
    @NotNull(message = "模板名称不能为空")
    @Length(min = 1, max = 64, message = "模板名称长度不能超过64个字符")
    private String name;

    @Schema(description = "模板内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "你好，{name}。你长的太{like}啦！")
    @NotNull(message = "模板内容不能为空")
    @Length(min = 1, max = 255, message = "模板内容长度不能超过255个字符")
    private String content;

    @Schema(description = "备注", example = "哈哈哈")
    @Length(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

    @Schema(description = "短信 API 的模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4383920")
    @NotNull(message = "短信 API 的模板编号不能为空")
    @Length(min = 1, max = 64, message = "短信 API 的模板编号长度不能超过64个字符")
    private String apiTemplateId;

}
