package net.northking.cctp.common.security.authorization;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 资源访问权限 <br>
 * <p>
 *
 * @author xiusong.xie
 * @since 1.0
 */
public class ResourceAuthority implements Serializable
{
  /**
   * 权限
   */
  private String authority;
  /**
   * 微服务名称
   */
  private String microService;

  /**
   * 资源HttpMethod
   */
  private String httpMethod;
  /**
   * 资源路径
   */
  private String path;

  /**
   * 角色列表
   */
  private List<String> roleList = new ArrayList<>();

  public ResourceAuthority()
  {
  }

  public ResourceAuthority(String authority, String microService, String httpMethod, String path)
  {
    this.authority = authority;
    this.microService = microService;
    this.httpMethod = httpMethod;
    this.path = path;
  }

  public void setAuthority(String authority)
  {
    this.authority = authority;
  }

  public String getMicroService()
  {
    return microService;
  }

  public void setMicroService(String microService)
  {
    this.microService = microService;
  }

  public String getPath()
  {
    return path;
  }

  public void setPath(String path)
  {
    this.path = path;
  }

  public String getHttpMethod()
  {
    return httpMethod;
  }

  public void setHttpMethod(String httpMethod)
  {
    this.httpMethod = httpMethod;
  }

  public String getAuthority()
  {
    return authority;
  }

  public List<String> getRoleList()
  {
    return roleList;
  }

  public void setRoleList(List<String> roleList)
  {
    this.roleList = roleList;
  }

  public void add(String role)
  {
    this.roleList.add(role);
  }
}
