package com.keao.edu.user.enums;

import com.keao.edu.common.enums.BaseEnum;

/**
 * @Author Joburgess
 * @Date 2020.07.24
 **/
public enum LevelEnum implements BaseEnum<Integer, LevelEnum> {
    ONE(1, "一级"),
    TWO(2, "一级"),
    THREE(3, "一级"),
    FOUR(4, "一级"),
    FIVE(5, "一级"),
    SIX(6, "一级"),
    SEVEN(7, "一级"),
    EIGHT(8, "一级"),
    NINE(9, "一级"),
    TEN(10, "一级"),;

    private Integer code;

    private String msg;

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

    @Override
    public Integer getCode() {
        return code;
    }

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

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static String getMsg(Integer code){
        for (LevelEnum levelEnum : values()) {
            if(levelEnum.getCode().equals(code)){
                return levelEnum.getMsg();
            }
        }
        return null;
    }
}
