# ScheduleEmailConfigDTO.java

    package cloud.wconnect.workperformance.pojo.dto.schedule;

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

    import jakarta.validation.Valid;
    import jakarta.validation.constraints.AssertTrue;
    import jakarta.validation.constraints.NotNull;
    import java.util.List;

    /**
     * DTO: Schedule Email Config
     *
     * @author yyt
     * 2023/7/3
     */
    @Data
    @NoArgsConstructor
    public class ScheduleEmailConfigDTO {

        /**
         * 邮件 id
         */
        private Integer id;

        /**
         * subject
         */
        @NotNull(message = "the subject must not be null", groups = {Addition.class, Edition.class})
        @Length(max = 200, message = "the subject max length is 200", groups = {Addition.class, Edition.class})
        private String subject;

        /**
         * 默认主题
         */
        private String defaultSubject;

        /**
         * 通知类型（1：history and forecast 报告缺失，2：申请部门权限通知, 3:history and forecast 报告缺失）
         */
        @NotNull(message = "the type must not be null", groups = {Addition.class, Edition.class})
        @Range(min = 1, max = 3, message = "the type must in [1: history and forecast reports are missing, 3: history and forecast report missing]", groups = {Addition.class})
        @Range(min = 2, max = 2, message = "the type must be 2: Apply for a department permission notice", groups = {Edition.class})
        private Integer type;

        /**
         * 推送人
         */
        @Valid
        private List<ScheduleEmailConfigTargetDTO> toList;

        /**
         * 抄送人
         */
        @Valid
        private List<ScheduleEmailConfigTargetDTO> ccList;

        /**
         * 状态（false：关闭，true：开启）
         */
        @NotNull(message = "the status must not be null", groups = {Addition.class, Edition.class})
        @AssertTrue(message = "the status must be true", groups = {Edition.class})
        private Boolean status;

        public void setSubject(String subject) {
            this.subject = subject.trim();
        }

        public ScheduleEmailConfigDTO(String defaultSubject) {
            this.defaultSubject = defaultSubject;
        }

    }