package com.njcn.system.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.constant.ValidMessage;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.*;


/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年12月17日 09:40
 */
@Data
public class DictTypeParam {

    @ApiModelProperty("名称")
    @NotBlank(message = ValidMessage.NAME_NOT_BLANK)
    @Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
    private String name;

    @ApiModelProperty("编码")
    @NotBlank(message = ValidMessage.CODE_NOT_BLANK)
    @Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.CODE_FORMAT_ERROR)
    private String code;


    @ApiModelProperty("排序")
    @NotNull(message = ValidMessage.SORT_NOT_NULL)
    @Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
    @Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
    private Integer sort;


    @ApiModelProperty("开启等级：0-不开启；1-开启，默认不开启")
    @NotNull(message = ValidMessage.OPEN_LEVEL_NOT_NULL)
    @Min(value = 0, message = ValidMessage.OPEN_LEVEL_FORMAT_ERROR)
    @Max(value = 1, message = ValidMessage.OPEN_LEVEL_FORMAT_ERROR)
    private Integer openLevel;


    @ApiModelProperty("开启算法描述：0-不开启；1-开启，默认不开启")
    @NotNull(message = ValidMessage.OPEN_DESCRIBE_NOT_NULL)
    @Min(value = 0, message = ValidMessage.OPEN_DESCRIBE_FORMAT_ERROR)
    @Max(value = 1, message = ValidMessage.OPEN_DESCRIBE_FORMAT_ERROR)
    private Integer openDescribe;


    @ApiModelProperty("描述")
    private String remark;

    /**
     * 更新操作实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class DictTypeUpdateParam extends DictTypeParam {


        @ApiModelProperty("id")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String id;

    }

    /**
     * 分页查询实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class DictTypeQueryParam extends BaseParam {


    }

}


