# CategoryDTO.java

    package cloud.wconnect.workperformance.pojo.dto.sva.category;

    import cloud.wconnect.commonlib.pojo.dto.group.Addition;
    import cloud.wconnect.commonlib.pojo.dto.group.Edition;
    import jakarta.validation.constraints.*;
    import lombok.AllArgsConstructor;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import org.hibernate.validator.constraints.Length;
    import org.hibernate.validator.constraints.Range;

    /**
     * DTO类: 加载部门数据
     *
     * @author zc
     * @date 2023/02/22
     */
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public class CategoryDTO {

        /**
         * 版本（yyyyMMdd），对标 Starting date
         */
        @Pattern(regexp = "^\\d{4}\\d{2}\\d{2}$", message = "The version format is incorrect, right format is [yyyyMMdd]", groups = Addition.class)
        private String version;

        /**
         * category 主键 id
         */
        @NotNull(message = "The categoryId cannot be null", groups = Edition.class)
        @Null(message = "The categoryId cannot be set", groups = Addition.class)
        private Integer categoryId;

        /**
         * property id
         */
        private Integer propertyId;

        /**
         * 部门数据的 id
         */
        @NotNull(message = "The departmentId cannot be null", groups = Edition.class)
        private Integer departmentId;

        /**
         * 部门 code
         */
        @NotBlank(message = "The departmentCode cannot be blank")
        @Length(max = 20, message = "The departmentCode is limited 20 characters")
        private String departmentCode;

        /**
         * category 名称
         */
        @NotEmpty(message = " The categoryName cannot be empty")
        @Length(max = 60, message = "The categoryName is limited 60 characters")
        private String categoryName;

        /**
         * Category Type（1：静态；2：可配置）
         */
        @NotNull(message = "The categoryType cannot be null")
        @Range(min = 1, max = 2, message = "The categoryType must limit in [1:static, 2:configurable].")
        private Integer categoryType;
    }