package com.ym.mec.auth.api.enums;

import org.apache.commons.lang3.StringUtils;

import com.ym.mec.common.enums.BaseEnum;

public enum SysUserType implements BaseEnum<String, SysUserType> {

	STUDENT("学生"), EDUCATION("教务老师"), TEACHER("指导老师"), SYSTEM("系统內置"), ADMIN("管理员");

	private String desc;

	private SysUserType(String desc) {
	}

	@Override
	public String getCode() {
		return name();
	}

	public String getDesc() {
		return desc;
	}

	public static SysUserType queryByName(String name) {
		if (StringUtils.isBlank(name)) {
			return null;
		}
		for (SysUserType sysUserType : SysUserType.values()) {
			if (name.equals(sysUserType.getCode())) {
				return sysUserType;
			}
		}
		return null;
	}
}
