# GuestLedgerCheckNotifyConfigEnum.java

    package cloud.wconnect.frontoffice.cons.guestledgercheck;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Guest Ledger Check 功能的通知类型枚举类
     *
     * @author lichen
     * @date 2024/11/14
     */
    @Getter
    @AllArgsConstructor
    public enum GuestLedgerCheckNotifyConfigEnum {

        /**
         * 等待解决的数据
         */
        WAITING_FOR_RESOLUTION(1, "guest-ledger-check.notify.subject.waiting-for-resolution");

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

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

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

    }