# HkEfficiencyNotifyTypeEnum.java

    package cloud.wconnect.workperformance.cons.hkefficiency;

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

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

    /**
     * Enum: Notify Type
     *
     * @author zc
     * @date 2024/11/12
     */
    @Getter
    @AllArgsConstructor
    public enum HkEfficiencyNotifyTypeEnum {

        // 1: HK Efficiency 报告缺失
        MISSING_REPORT_HK_EFFICIENCY(1, NotifySubjectI18nCons.MISSING_REPORT),
        // 2: Operating 报告缺失
        MISSING_REPORT_HK_OPERATING(2, NotifySubjectI18nCons.MISSING_REPORT);

        /**
         * 通知类型
         */
        private final Integer type;
        /**
         * 默认通知主题的国际化code
         */
        private final String defaultSubjectI18nCode;

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