From f66e9016d77a0d500df285ff58a581b31eb54055 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 08 一月 2025 08:21:43 +0800 Subject: [PATCH] DaPointDao代码优化 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/influxdb/common/config/InfluxDBInstance.java | 11 +++++++++-- 1 files changed, 9 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 7803bec..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,4 +46,8 @@ return client; } + public String getBucket() { + return BUCKET_NAME + TenantContextHolder.getRequiredTenantId(); + } + } -- Gitblit v1.9.3