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

import com.cf.imes.framework.common.pojo.PageParam;
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 lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;

import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 短信模板分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SmsTemplatePageReqVO extends PageParam {

    @Schema(description = "短信模板类型", example = "1")
    @SmsTemplateTypeValid
    private Integer type;

    @Schema(description = "开启状态", example = "1")
    @CommonStatus
    private Integer status;

    @Schema(description = "模板编码，模糊匹配", example = "test_01")
    @Size(max = 64, message = "模板编码长度不能超过64个字符")
    private String code;

    @Schema(description = "短信 API 的模板编号，模糊匹配", example = "4383920")
    @Size(max = 64, message = "短信 API 的模板编号长度不能超过64个字符")
    private String apiTemplateId;

    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    @Schema(description = "创建时间")
    private LocalDateTime[] createTime;

}
