From 7cd87e30ed364aa6806eaa28939ea94ad1524a50 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 08 三月 2024 14:46:50 +0800 Subject: [PATCH] 部门增加管理员 --- src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java b/src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java index 668ca74..7605048 100644 --- a/src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java +++ b/src/main/java/com/mindskip/xzs/domain/enums/QuestionTypeEnum.java @@ -1,6 +1,7 @@ package com.mindskip.xzs.domain.enums; import java.util.HashMap; +import java.util.List; import java.util.Map; public enum QuestionTypeEnum { @@ -28,6 +29,19 @@ } } + public static Integer get(String text){ + if("".equals(text) || text == null){ + return null; + } + QuestionTypeEnum[] enums = QuestionTypeEnum.values(); + for (QuestionTypeEnum anEnum : enums) { + if(anEnum.getName().equals(text)){ + return anEnum.getCode(); + } + } + return null; + } + public static QuestionTypeEnum fromCode(Integer code) { return keyMap.get(code); } -- Gitblit v1.8.0