# WalkRoomStatusEnum.java

    package cloud.wconnect.frontoffice.cons.walkroomrequest;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * walkRoom状态枚举类
     * (1:checked-in 2:no-show 3:cancelled 4:early check-out)
     *
     * @author lichen
     * @date 2023/7/11
     */
    @Getter
    @AllArgsConstructor
    public enum WalkRoomStatusEnum {

        /**
         * 入住
         */
        CHECKED_IN(1,"walk-room-request.guest-status.checked-in"),
        /**
         * 客人未来
         */
        NO_SHOW(2,"walk-room-request.guest-status.no-show"),
        /**
         * 客人取消
         */
        CANCELLED(3,"walk-room-request.guest-status.cancelled"),
        /**
         * 提前退房
         */
        EARLY_CHECK_OUT(4,"walk-room-request.guest-status.early-check-out");

        private int code;

        /**
         * 国际化code
         */
        private String i18nCode;

        /**
         * 获取i18nCode
         *
         * @param code 状态码
         * @return java.lang.String
         * @author lichen
         * @date 2024/1/19
         */
        public static String getI18nCode(int code) {
            Optional<WalkRoomStatusEnum> optional = Arrays.stream(WalkRoomStatusEnum.values()).filter(item -> item.getCode() == code).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }
    }