# GmwrCommentCategoryEnum.java

    package cloud.wconnect.workperformance.cons.gmwr.comment;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

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

    /**
     * Enum: Comment Category
     *
     * @author zc
     * @date 2025/02/28
     */
    @Getter
    @AllArgsConstructor
    public enum GmwrCommentCategoryEnum {

        PROFIT(1, "Profit", List.of(GmwrCommentItemEnum.REVENUE.getCategory(),
                GmwrCommentItemEnum.EXPENSE.getCategory())),

        PEOPLE(2, "People", List.of(GmwrCommentItemEnum.OPEN_POSITION.getCategory(),
                GmwrCommentItemEnum.TRAINING.getCategory(), GmwrCommentItemEnum.EMPLOYEE_FEEDBACK.getCategory())),

        PRODUCT(3, "Product", List.of(GmwrCommentItemEnum.GUEST_SERVICE.getCategory(),
                GmwrCommentItemEnum.QUALITY.getCategory(), GmwrCommentItemEnum.OOO_ROOMS.getCategory(),
                GmwrCommentItemEnum.CAPITOL_PROJECT.getCategory(), GmwrCommentItemEnum.IT.getCategory()));

        private final int category;

        private final String categoryName;

        private final List<Integer> items;

        /**
         * 获取分类名称
         *
         * @param category 分类
         * @return java.lang.String
         * @author zc
         * @date 2025/2/28
         */
        public static String getCategoryName(int category) {
            Optional<GmwrCommentCategoryEnum> optional = Arrays.stream(GmwrCommentCategoryEnum.values())
                    .filter(item -> item.getCategory() == category).findFirst();
            return optional.isPresent() ? optional.get().getCategoryName() : "";
        }

    }