# ItticketNotificationDTO.java

    package cloud.wconnect.it.pojo.dto.itrequest;

    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.NotNull;
    import java.util.List;

    /**
     * DTO: Itticket Notification
     *
     * @author yyt
     * 2023/3/28
     */
    @Data
    @NoArgsConstructor
    public class ItticketNotificationDTO {

        /**
         * 通知 id
         */
        private Integer id;

        /**
         * subject
         */
        @NotNull(message = "the subject must not be null")
        @Length(max = 200, message = "the subject max length is 200")
        private String subject;

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

        /**
         * 通知类型（1.new it request notify，2.it request change）
         */
        @NotNull(message = "the type must not be null")
        @Range(min = 1, max = 2, message = "the type must is [1: new it request notify, 2: it request change]")
        private Integer type;

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

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

        /**
         * 状态（false：关闭，true：开启）
         */
        @NotNull(message = "the status must not be null")
        private Boolean status;

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

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

    }