# ItRequestStatusEnum.java

    package cloud.wconnect.it.cons.itrequest;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * @author: yyt
     * 2024-04-15
     */
    @AllArgsConstructor
    @Getter
    public enum ItRequestStatusEnum {

        OPEN(0, "it-request.status.open"),

        CLOSED(1, "it-request.status.closed"),

        IN_PROGRESS(2, "it-request.status.inProgress"),

        WAIT_CONFIRM(3, "it-request.status.waitConfirm");

        private final int code;

        private final String i18nCode;

        public static String getI18nCode(int code) {
            Optional<ItRequestStatusEnum> optional = Arrays.stream(ItRequestStatusEnum.values())
                    .filter(item -> item.getCode() == code).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }

    }