liusheng
2025-01-02 b6dd47b05107fc36d8ff4f7f29a4446521f95503
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
45
46
47
48
49
50
package com.ruoyi.common.enums;
 
/**
 * Created by Jiangyue on 2022/1/18.
 */
public enum Education {
    DOCTOR("doctor", "博士"),
    MASTER("master","硕士"),
    BACHELOR("bachelor","本科"),
    COLLEGE("college","专科"),
    SENIORHIGHSCHOOL("seniorhighschool","高中"),
    JUNIORHIGHSCHOOL("juniorhighschool","初中"),
    PRIMARYSCHOOL("primaryschool","小学"),
    PRESCHOOL("preschool","学前");
 
 
    private String code;
    private String desc;
    Education(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    public static String getDescByCode(String code) {
        Education[] educations = values();
        for (int i = 0; i < educations.length; i++) {
            Education education = educations[i];
            if (code.trim().equals(education.getCode())) {
                return education.getDesc();
            }
        }
        return null;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public void setDesc(String desc) {
        this.desc = desc;
    }
}