package org.dromara.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户状态
 *
 * @author ruoyi
 */
@Getter
@AllArgsConstructor
public enum BusRole {
    /**
     * 平台
     */
    PLATFORM(5, "平台"),
    /**
     * 服务商
     */
    SERVICE(6, "服务商"),
    /**
     * 运营商
     */
    OPERATOR(7, "运营商"),
    /**
     * 代理商
     */
    AGENT(8, "代理商"),
    /**
     * 商户
     */
    MERCHANT(9,"商户"),
    /**
     * 自雇者
     */
    WORKER(10, "自雇者");

    private final int id;
    private final String name;



    public static String getName(Integer id){
      BusRole[] brs =   BusRole.values();
      for(BusRole br: brs){
          if(br.getId() == id){
              return br.getName();
          }
      }

      return null;
    }

    public static BusRole getRole(Integer id){
        BusRole[] brs =   BusRole.values();
        for(BusRole br: brs){
            if(br.getId() == id){
                return br;
            }
        }

        return null;
    }


}
