package org.jeecg.modules.system.enums;


/**
 * 用户类型
 */
public enum UserType {
    //管理员
    ADMIN(1, "admin"),

    //考生
    STUDENT(2, "student"),

    //讲师
    TEACHER(3, "teacher");

    private Integer code;

    private String value;

    UserType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static UserType getByCode(Integer code) {
        for (UserType userType : values()) {
            if (userType.getCode().equals(code)) {
                return userType;
            }
        }
        return null;
    }

}
