# OooEmailConfigDTO.java

    package cloud.wconnect.frontoffice.pojo.dto.oooroom;

    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: Ooo Email Config
     *
     * @author yyt
     * 2023/8/7
     */
    @Data
    @NoArgsConstructor
    public class OooEmailConfigDTO {

        /**
         * 数据 id
         */
        private Integer id;

        /**
         * 资产 id
         */
        private Integer propertyId;

        /**
         * 邮件主题
         */
        @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：报告缺失，2：未关闭房间通知
         */
        @NotNull(message = "the type must not be null")
        @Range(min = 1, max = 2, message = "the type must in [1: report missing, 2: notify not closed]")
        private Integer type;

        /**
         * 收件人
         */
        @Valid
        private List<OooEmailTargetDTO> toList;

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

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

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

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

    }