package com.yuchen.saas.flow.api.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户节点类型枚举
 */
@Getter
@AllArgsConstructor
public enum NodeUserTypeEnum {

    USER("user","用户"),
    DEPT("dept","部门"),
    ROLE("role","角色"),
    ;

    private final String key;

    private final String name;

    public static NodeUserTypeEnum getEnumByCode(String code) {
        NodeUserTypeEnum[] enumArray = NodeUserTypeEnum.values();
        for (NodeUserTypeEnum e : enumArray) {
            if (e.getKey().equals(code)) {
                return e;
            }
        }
        return null;
    }


}
