# BookingStatusForOperaGroupPicupEnum.java

    package cloud.wconnect.rateshop.cons.rateshop;

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

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

    /**
     * 枚举类: 预定状态
     *
     * @author yyt
     * @date 2025/06/25
     */
    @Getter
    @AllArgsConstructor
    public enum BookingStatusForOperaGroupPicupEnum {

        DEFINITE(1, BookingStatusEnum.DEFINITE.getSymbol(), BookingStatusEnum.DEFINITE.getI18nCode()),
        TENTATIVE(2, BookingStatusEnum.TENTATIVE.getSymbol(), BookingStatusEnum.TENTATIVE.getI18nCode());

        private final int code;

        private final String symbol;

        private final String i18nCode;

        /**
         * 获取 code
         *
         * @param symbol 标识
         * @return code
         * @author yyt
         * @date 2025/6/25
         */
        public static int getCodeBySymbol(String symbol) {
            Optional<BookingStatusForOperaGroupPicupEnum> optional = Arrays.stream(BookingStatusForOperaGroupPicupEnum.values())
                    .filter(item -> item.getSymbol().equals(symbol)).findFirst();
            return optional.map(BookingStatusForOperaGroupPicupEnum::getCode).orElse(BaseConstant.ZERO);
        }
    }