package com.CUST.brain.common.enums;

import lombok.Getter;

/**
 * 学历枚举
 */
@Getter
public enum EducationEnum {
    
    /**
     * 博士
     */
    DOCTOR("DOCTOR", "博士", "1", 1),
    
    /**
     * 硕士
     */
    MASTER("MASTER", "硕士", "2", 2),
    
    /**
     * 本科
     */
    BACHELOR("BACHELOR", "本科", "3", 3),
    
    /**
     * 专科
     */
    COLLEGE("COLLEGE", "专科", "4", 4),
    
    /**
     * 其他
     */
    OTHER("OTHER", "其他", "5", 5);

    private final String code;
    private final String name;
    private final String value;
    private final Integer sort;

    EducationEnum(String code, String name, String value, Integer sort) {
        this.code = code;
        this.name = name;
        this.value = value;
        this.sort = sort;
    }

    public static EducationEnum getByCode(String code) {
        for (EducationEnum education : values()) {
            if (education.getCode().equals(code)) {
                return education;
            }
        }
        return null;
    }

    public static EducationEnum getByValue(String value) {
        for (EducationEnum education : values()) {
            if (education.getValue().equals(value)) {
                return education;
            }
        }
        return null;
    }
} 