package com.yonge.cooleshow.auth.api.enums;

import com.yonge.toolset.base.enums.BaseEnum;
import org.apache.commons.lang3.StringUtils;

public enum SysUserType implements BaseEnum<String, SysUserType> {

	STUDENT("学生"), TEACHER("指导老师"), SYSTEM("系统內置");

	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;
	}
}
