1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| package com.mindskip.xzs.domain.enums;
|
| import lombok.Getter;
|
| /**
| * @author:xp
| * @date:2024/5/14 9:16
| */
| @Getter
| public enum PracticeQuestionTypeEnum {
|
| ALL("all", -99,"不限类型"),
| SINGLE("single", 1,"单选"),
| MULTIPLE("multiple", 2,"多选"),
| JUDGE("judge", 3,"判断"),
| ;
|
|
| private final String value;
| /** 题目表中的值 */
| private final Integer dataBaseValue;
| private final String desc;
|
| PracticeQuestionTypeEnum(String value, Integer dataBaseValue, String desc) {
| this.value = value;
| this.dataBaseValue = dataBaseValue;
| this.desc = desc;
| }
|
| /**
| * 根据值获取数据库值
| *
| * @param value
| * @return
| */
| public static Integer getDataBaseValueByValue(String value) {
| for (PracticeQuestionTypeEnum practiceQuestionTypeEnum : PracticeQuestionTypeEnum.values()) {
| if (practiceQuestionTypeEnum.getValue().equals(value)) {
| return practiceQuestionTypeEnum.dataBaseValue;
| }
| }
| return -1;
| }
| }
|
|