package com.yonge.cooleshow.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;

public enum UserStatusEnum implements BaseEnum<String, UserStatusEnum> {

	NORMAL("正常"),
	LOCKED("冻结"),
    CLOSED("注销"),
    ;

    @EnumValue
    private String code;
    private String msg;

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

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

    public String getMsg() {
        return msg;
    }

	public static UserStatusEnum codeOf(String code) {
		for (UserStatusEnum userStatus : UserStatusEnum.values()) {
			if (code.equals(userStatus.getCode())) {
				return userStatus;
			}
		}
		return null;
	}
}
