package com.yuchen.saas.manage.system.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 功能相关
 */
@Getter
@AllArgsConstructor
public enum NestRoleEnum {
    COMMON(0, "普通"),
    ADMIN(1, "主管理员"),
    MANAGER(2, "子管理员（主管）"),
            ;

    final Integer code;
    final String name;

    public static NestRoleEnum of(String name) {
        if (name == null) {
            return null;
        }
        NestRoleEnum[] values = NestRoleEnum.values();
        for (NestRoleEnum nestRoleEnum : values) {
            if (nestRoleEnum.name.equals(name)) {
                return nestRoleEnum;
            }
        }
        return null;
    }







}