# WalkRoomEmailConfigDTO.java

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

    import lombok.*;
    import lombok.experimental.Accessors;
    import org.hibernate.validator.constraints.Length;
    import org.hibernate.validator.constraints.Range;

    import jakarta.validation.Valid;
    import jakarta.validation.constraints.NotNull;
    import java.io.Serializable;
    import java.util.List;

    /**
     * @author lichen
     * @description 邮件配置 DTO
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    public class WalkRoomEmailConfigDTO implements Serializable {

        private static final long serialVersionUID = 1L;

        @NotNull(message = "The id cannot be null")
        private Integer id;

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

        /**
         * 邮件主题
         */
        @NotNull(message = "The subject cannot be null")
        @Length(max = 200, message = "The subject max length is 200 chars.")
        private String subject;

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

        /**
         * 邮件配置类型1:发送方审批 2:接收方审批 3:保存
         */
        @NotNull(message = "The type cannot be null")
        @Range(min = 1, max = 3, message = "The type must be 1:Sender wait for approving 2:Receiver wait for approving 3:Save")
        private Integer type;

        /**
         * 收件人集合
         */
        @Valid
        private List<WalkRoomEmailTargetDTO> toList;
        /**
         * 抄送人集合
         */
        @Valid
        private List<WalkRoomEmailTargetDTO> ccList;

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

        /**
         * 根据资产id 和 类型生成key
         *
         * @param propertyId 资产id
         * @param type       邮件配置类型
         * @return java.lang.String
         * @author lichen
         * @date 2023/7/22
         */
        public static String generateKey(Integer propertyId, Integer type) {
            return propertyId.toString() + "_" + type.toString();
        }

    }