package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: gululuq
 * @description: 用户分类
 * @author: bao
 * @create: 2022-02-14
 */
@AllArgsConstructor
@Getter
public enum EUserType {
    ORDINARY("00", "系统用户"),// 后台系统用户
    REGISTER("01", "注册用户"),// 后台注册用户
    WECHAT("10", "微信用户"); // 微信用户

    private String val;
    private String desc;

    // 解析
    public static EUserType parseByVal(String val) {
        for (EUserType type : EUserType.values()) {
            if (type.getVal().equalsIgnoreCase(val)) {
                return type;
            }
        }
        return EUserType.ORDINARY;
    }
}
