From 4be7d863a161b64f8592a789d699e807545e7dc6 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 15 十一月 2024 16:46:12 +0800 Subject: [PATCH] 计划数据 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 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 fa23641..69ef90b 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,16 @@ @Value("${influx-db.org}") public String org; - @Value("${influx-db.bucket}") - public String bucket; + /*@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 = "bucket_"; private Logger logger = LoggerFactory.getLogger(getClass()); @@ -43,5 +46,8 @@ return client; } + public String getBucket() { + return BUCKET_NAME + TenantContextHolder.getRequiredTenantId(); + } } -- Gitblit v1.9.3