# BudgetDatabaseNotifyTypeEnum.java

    package cloud.wconnect.rateshop.cons.budgetdatabase;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: Notify Type
     *
     * @author yyt
     * @date 2025/8/16
     */
    @Getter
    @AllArgsConstructor
    public enum BudgetDatabaseNotifyTypeEnum {

        EXPIRATION_NOTICE(BudgetDatabaseNotifyCons.EXPIRATION_NOTICE, "budget-database.notify.subject.expiration-notice");

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

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