From f7e880deb0612ba5efe96e6ce229abd8c19bc6e7 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期二, 03 九月 2024 09:08:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java index 7803bec..a46e8af 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java @@ -1,5 +1,6 @@ package com.iailab.module.data.influxdb.common.config; +import com.iailab.framework.tenant.core.context.TenantContextHolder; import com.influxdb.client.InfluxDBClient; import com.influxdb.client.InfluxDBClientFactory; import org.slf4j.Logger; @@ -18,14 +19,13 @@ @Value("${influx-db.org}") public String org; - @Value("${influx-db.bucket}") - public String bucket; - @Value("${influx-db.token}") public String token; @Value("${influx-db.url}") public String url; + + private final static String BUCKET_NAME = "tenant_"; private Logger logger = LoggerFactory.getLogger(getClass()); @@ -43,4 +43,8 @@ return client; } + public String getBucket() { + return BUCKET_NAME + TenantContextHolder.getRequiredTenantId(); + } + } -- Gitblit v1.9.3