/*
 * Copyright (c) 京北方信息技术股份有限公司 Corporation 2021 . All rights reserved.
 *
 */
package net.northking.cctp.common.saas;

/**
 * 租户对象
 *
 * @author : xiusong.xie
 * @version : 1.0
 */
public class Tenant
{
  private static final String ISOLATION_LEVEL_I = "I";
  private static final String ISOLATION_LEVEL_II = "II";
  private static final String ISOLATION_LEVEL_III = "III";

  private String id;
  /**
   * 租户代码<br>
   */
  private String tenantCode;
  /**
   * 租户名称<br>
   */
  private String tenantName;

  /**
   * 最大在线用户数量<br>
   */
  private Integer maxOnlineUser;

  /**
   * 数据隔离级别<br>
   */
  private String isolationLevel;

  /**
   * 租户状态<br>
   */
  private String tenantStatus;

  /**
   * 是否删除<br>
   */
  private Boolean deleted;

  /**
   * 二级菜单位置<br>
   */
  private Boolean position;

  /**
   * 是否展示系统空间<br>
   */
  private Boolean projectSpace;

  /**
   * 租户logoId
   */
  private String logoId;

  public Tenant()
  {
  }

  public Tenant(String id, String tenantCode, String tenantName,
                Integer maxOnlineUser, String isolationLevel,
                String tenantStatus, Boolean deleted,Boolean position,Boolean projectSpace,String logoId) {
    this.id = id;
    this.tenantCode = tenantCode;
    this.tenantName = tenantName;
    this.maxOnlineUser = maxOnlineUser;
    this.isolationLevel = isolationLevel;
    this.tenantStatus = tenantStatus;
    this.deleted = deleted;
    this.position = position;
    this.projectSpace = projectSpace;
    this.logoId = logoId;
  }

  public Tenant(String id, String tenantCode, String tenantName, Integer maxOnlineUser)
  {
    this.id = id;
    this.tenantCode = tenantCode;
    this.tenantName = tenantName;
    this.maxOnlineUser = maxOnlineUser;
  }

  public String getLogoId() {
    return logoId;
  }

  public void setLogoId(String logoId) {
    this.logoId = logoId;
  }

  public String getId()
  {
    return id;
  }

  public void setId(String id)
  {
    this.id = id;
  }

  /**
   * 租户代码<br>
   */
  public String getTenantCode()
  {
    return tenantCode;
  }

  /**
   * 租户代码<br>
   *
   * @param tenantCode 租户代码
   */
  public void setTenantCode(String tenantCode)
  {
    this.tenantCode = tenantCode;
  }

  /**
   * 租户名称<br>
   */
  public String getTenantName()
  {
    return tenantName;
  }

  /**
   * 租户名称<br>
   *
   * @param tenantName 租户名称
   */
  public void setTenantName(String tenantName)
  {
    this.tenantName = tenantName;
  }

  /**
   * 最大在线用户数量<br>
   */
  public Integer getMaxOnlineUser()
  {
    return maxOnlineUser;
  }

  /**
   * 最大在线用户数量<br>
   *
   * @param maxOnlineUser 最大在线用户数量
   */
  public void setMaxOnlineUser(Integer maxOnlineUser)
  {
    this.maxOnlineUser = maxOnlineUser;
  }

  public String getIsolationLevel()
  {
    return isolationLevel;
  }

  public void setIsolationLevel(String isolationLevel)
  {
    this.isolationLevel = isolationLevel;
  }

  public String getTenantStatus() {
    return tenantStatus;
  }

  public void setTenantStatus(String tenantStatus) {
    this.tenantStatus = tenantStatus;
  }

  public Boolean getDeleted() {
    return deleted;
  }

  public void setDeleted(Boolean deleted) {
    this.deleted = deleted;
  }

  public Boolean getPosition() {
    return position;
  }

  public void setPosition(Boolean position) {
    this.position = position;
  }

  public Boolean getProjectSpace() {
    return projectSpace;
  }

  public void setProjectSpace(Boolean projectSpace) {
    this.projectSpace = projectSpace;
  }

  public String schemaSuffix()
  {
    if (ISOLATION_LEVEL_II.equalsIgnoreCase(isolationLevel))
    {
      return "_" + this.tenantCode;
    }
    return "";
  }
}
