package com.schisandra.auth.common.enums;

import lombok.Getter;

/**
 * 删除状态枚举
 * 
 * @author: schisandra
 */
@Getter
public enum UserStatusEnum {

    UN_NORMAL(1,"异常"),
    NORMAL(0,"正常"),
    BANED(-1,"禁用");

    public int code;

    public String desc;

    UserStatusEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static UserStatusEnum getByCode(int codeVal){
        for(UserStatusEnum resultCodeEnum : UserStatusEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }

}
