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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务权限类型
 */
@Getter
@AllArgsConstructor
public enum BusinessScopeEnum {

    PARK(1, "园区"),
    PARKING(2, "停车场"),
    CHARGE(3, "充电"),
    ;

    final Integer code;
    final String name;

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