package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: xingxi
 * @description: 权限字符串几个固定的
 * @author: baolei
 * @create: 2025-03-18 22:37
 */
@AllArgsConstructor
@Getter
public enum ERoleKey {
    ADMIN("ADMIN", "管理员"),
    PLATFORM("PLATFORM", "平台管理"),
    MERCHANT("MERCHANT", "经销商"),
    VENDOR("VENDOR", "供应商"),
    CUSTOMER("CUSTOMER", "零售客户");

    private String code;
    private String desc;

    /** 解析*/
    public static ERoleKey parse(String val) {
        for(ERoleKey type :ERoleKey.values()) {
            if(type.getCode().equalsIgnoreCase(val)) {
                return type;
            }
        }
        return null;
    }
}
