package com.wzj.soopin.member.enums;

/**
 * 会员角色枚举
 */
public enum MemberRoleEnum {
    /**
     * 代理
     */
    TENANT_PROXY(1,"tenantProxy"),
    /**
     * 租户普通用户
     */
    TENANT_STORE(2,"tenantStore"),
    /**
     * 租户访客
     */
    TENANT_DARREN(3,"tenantDarren"),


    /**
     * 系统管理员
     */
    SYSTEM_ADMIN(4,"systemAdmin"),

    /**
     * 普通用户
     */
    COMMON_USER(5,"commonUser");
    /**
     * 角色
     */
    private final String role;

    private final int value;

    MemberRoleEnum(int value, String role) {
        this.value = value;
        this.role = role;
    }

    public String getRole() {
        return role;
    }

    public static MemberRoleEnum getByRole(String role) {
        for (MemberRoleEnum memberRoleEnum : MemberRoleEnum.values()) {
            if (memberRoleEnum.getRole().equals(role)) {
                return memberRoleEnum;
            }
        }
        return null;
    }
}
