package com.cf.imes.module.system.controller.admin.systemconfig.vo;

import com.cf.imes.module.system.validation.config.SystemConfigTypeEnumValid;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

/**
 * 基础配置创建/修改 vo
 *
 * @author Gqr
 * @since 2024/11/7 17:09
 */
@Schema(description = "管理后台 - 基础配置创建/修改 Request VO")
@Data
public class ConfigSaveReqVO {
    @Schema(description = "基础配置编号", example = "1")
    private Long id;

    @Schema(description = "基础配置名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "自定义编号")
    @NotBlank(message = "基础配置名称不能为空")
    @Size(max = 64, message = "基础配置名称长度不能超过 64 个字符")
    private String name;

    @Schema(description = "配置类型：1 自定义板编号,2 智能分线,3 高级筛选'", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "配置类型不能为空")
    @SystemConfigTypeEnumValid
    private Integer type;

    @Schema(description = "配置规则")
    private String setting;

    @JsonIgnore
    @Schema(hidden = true)
    private int version;
}
