|
@@ -3,7 +3,6 @@ package com.platform.dao.config;
|
|
|
import com.influxdb.LogLevel;
|
|
|
import com.influxdb.client.InfluxDBClient;
|
|
|
import com.influxdb.client.InfluxDBClientFactory;
|
|
|
-import com.platform.dao.util.influxDB.InfluxDBFluxExpression;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
@@ -12,16 +11,19 @@ import org.springframework.context.annotation.Configuration;
|
|
|
/**
|
|
|
* influx配置类
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
@Configuration
|
|
|
+@Slf4j
|
|
|
public class InfluxDbConfig {
|
|
|
-
|
|
|
+ @Value("${influx.token}")
|
|
|
+ private String token;
|
|
|
+ @Value("${influx.url}")
|
|
|
+ private String url;
|
|
|
@Bean
|
|
|
public InfluxDBClient influxDBClient() {
|
|
|
|
|
|
- System.out.println("=============="+ InfluxDBFluxExpression.token+"==============");
|
|
|
- System.out.println("=============="+InfluxDBFluxExpression.url+"==============");
|
|
|
- InfluxDBClient influxDBClient = InfluxDBClientFactory.create(InfluxDBFluxExpression.url, InfluxDBFluxExpression.token.toCharArray());
|
|
|
+ log.info("=============="+ token+"==============");
|
|
|
+ log.info("=============="+url+"==============");
|
|
|
+ InfluxDBClient influxDBClient = InfluxDBClientFactory.create(url, token.toCharArray());
|
|
|
influxDBClient.setLogLevel(LogLevel.BASIC);
|
|
|
return influxDBClient;
|
|
|
|