All Downloads are FREE. Search and download functionalities are using the official Maven repository.

love.keeping.starter.web.components.cache.CacheVariables Maven / Gradle / Ivy

The newest version!
package love.keeping.starter.web.components.cache;

import love.keeping.starter.common.constants.StringPool;
import love.keeping.starter.web.common.tenant.TenantContextHolder;
import love.keeping.starter.web.utils.TenantUtil;

/**
 * 缓存变量
 */
public class CacheVariables {

  /**
   * 租户ID
   *
   * @return
   */
  public static String tenantId() {
    if (!TenantUtil.enableTenant()) {
      return StringPool.EMPTY_STR;
    }
    Integer tenantId = TenantContextHolder.getTenantId();
    if (tenantId == null) {
      return StringPool.EMPTY_STR;
    }

    return String.valueOf(tenantId) + "::";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy