# RateShopNotifyConfigTypeEnum.java

    package cloud.wconnect.rateshop.cons.rateshop;

    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/14
     */
    @Getter
    @AllArgsConstructor
    public enum RateShopNotifyConfigTypeEnum {

        /**
         * 警告信息
         */
        ALERT_MESSAGE(1, "rate-shop.notify.subject.alert-message"),
        /**
         * History And Forecast 报告缺失
         */
        HISTORY_AND_FORECAST_REPORT_MISSED(2, NotifySubjectI18nCons.MISSING_REPORT),
        /**
         * Group pickup 报告缺失
         */
        GROUP_PICKUP_REPORT_MISSED(3, NotifySubjectI18nCons.MISSING_REPORT),
        /**
         * Occ Snapshot for the next N Days 通知
         */
        OCC_SNAPSHOT_FOR_THE_NEXT_N_DAYS(4, "rate-shop.notify.subject.occ-snapshot"),

        /**
         * Occupancy Summary 报告缺失
         */
        OCCUPANCY_SUMMARY_REPORT_MISSED(5, NotifySubjectI18nCons.MISSING_REPORT),

        /**
         * Market Segment Summary 报告缺失
         */
        MARKET_SEGMENT_SUMMARY_REPORT_MISSED(6, NotifySubjectI18nCons.MISSING_REPORT);

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

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

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

    }