# GmwrStatusEnum.java

    package cloud.wconnect.workperformance.cons.gmwr;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: GM Weekly Report Status
     *
     * @author zc
     * @date 2024/10/16
     */
    @AllArgsConstructor
    @Getter
    public enum GmwrStatusEnum {

        /**
         * Draft
         */
        DRAFT(1, "gm-weekly-report.draft"),

        /**
         * Complete
         */
        COMPLETE(2, "gm-weekly-report.complete");

        private final int status;

        private final String i18nCode;

        /**
         * 获取国际化code
         *
         * @param status 状态
         * @return java.lang.String
         * @author zc
         * @date 2024/1/15
         */
        public static String getI18nCode(int status) {
            Optional<GmwrStatusEnum> optional = Arrays.stream(GmwrStatusEnum.values())
                    .filter(item -> item.getStatus() == status).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }
    }