# CompRoomNotifyConfigTypeEnum.java

    package cloud.wconnect.frontoffice.cons.comproom;

    import cloud.wconnect.commonlib.cons.NotifySubjectI18nCons;
    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * 免费房通知类型枚举类
     *
     * @author lichen
     * @date 2024/11/13
     */
    @Getter
    @AllArgsConstructor
    public enum CompRoomNotifyConfigTypeEnum {

        /**
         * 免费房入住通知
         */
        COMP_ROOM_CHECK_IN(1, "comp-room.notify.subject.comp-room-check-in"),
        /**
         * 报告缺失通知
         */
        REPORT_MISSED(2, NotifySubjectI18nCons.MISSING_REPORT),
        /**
         * 待审批的通知
         */
        WAIT_FOR_APPROVING(3,NotifySubjectI18nCons.WAITING_FOR_APPROVAL);

        /**
         * 通知类型
         */
        private int type;

        /**
         * 默认通知主题的国际化code
         */
        private String defaultSubjectI18nCode;

        /**
         * 根据类型获取默认主题的国际化code
         *
         * @param type 类型
         * @return java.lang.String
         * @author lichen
         * @date 2024/11/12
         */
        public static String getDefaultSubjectI18nCode(int type){
            Optional<CompRoomNotifyConfigTypeEnum> optional = Arrays.stream(CompRoomNotifyConfigTypeEnum.values()).filter(item -> item.getType() == type).findFirst();
            return optional.isEmpty() ? "" : optional.get().getDefaultSubjectI18nCode();
        }
    }