package com.ym.mec.biz.dal.enums;

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

/**
 * 学员级别
 */
public enum LevelEnum implements BaseEnum<String, LevelEnum> {
    one("一级"),
    two("二级"),
    three("三级");

    private String code;
    private String msg;

    LevelEnum(String msg) {
        this.code = this.name();
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    public String getCode() {
        return this.code;
    }


    public static LevelEnum getByName(String name) {
        for (LevelEnum level : LevelEnum.values()) {
            if (level.getMsg().equals(name)) {
                return level;
            }
        }
        return null;
    }

}
