# BlacklistTypeEnum.java

    package cloud.wconnect.frontoffice.cons.badguest;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * 黑名单类型
     *
     * @author lichen
     * @date 2024/10/15
     */
    @Getter
    @AllArgsConstructor
    public enum BlacklistTypeEnum {

        /**
         * 客房
         */
        GUEST_ROOMS(1, "blacklist.type.guest-rooms"),
        /**
         * 会议宴会厅
         */
        MEETING_BANQUET_ROOMS(2, "blacklist.type.meeting-banquet-rooms");

        private int type;

        private String i18nCode;

        /**
         * 获取类型
         *
         * @param type 类型
         * @return java.lang.String
         * @author lichen
         * @date 2024/10/15
         */
        public static String getI18nCodeByType(int type) {
            Optional<BlacklistTypeEnum> optional = Arrays.stream(BlacklistTypeEnum.values()).filter(item -> item.getType() == type).findFirst();
            return optional.isEmpty() ? "" : optional.get().getI18nCode();
        }

    }