微调
This commit is contained in:
@@ -2,6 +2,8 @@ package com.njcn.influx.config;
|
||||
|
||||
import com.njcn.influx.base.ProxyMapperRegister;
|
||||
import com.njcn.influx.core.InfluxExecutor;
|
||||
import com.njcn.influx.utils.InfluxDbUtils;
|
||||
import lombok.Data;
|
||||
import org.influxdb.InfluxDB;
|
||||
import org.influxdb.impl.InfluxDBMapper;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -15,6 +17,7 @@ import org.springframework.core.io.ResourceLoader;
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
public class InfluxDbConfig {
|
||||
|
||||
@@ -22,12 +25,21 @@ public class InfluxDbConfig {
|
||||
/***
|
||||
* influxMapper存放路径
|
||||
*/
|
||||
@Value("${spring.influx.mapper-location}")
|
||||
@Value("${spring.influx.mapper-location:com.njcn.influx.imapper}")
|
||||
private String mapperLocation;
|
||||
|
||||
@Value("${spring.influx.database}")
|
||||
private String database;
|
||||
|
||||
@Value("${spring.influx.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${spring.influx.user}")
|
||||
private String user;
|
||||
|
||||
@Value("${spring.influx.password}")
|
||||
private String password;
|
||||
|
||||
@Bean(name = "influxDbMapper")
|
||||
public InfluxDBMapper influxDbMapper(InfluxDB influxDb) {
|
||||
influxDb.setLogLevel(InfluxDB.LogLevel.BASIC);
|
||||
@@ -44,4 +56,10 @@ public class InfluxDbConfig {
|
||||
return new ProxyMapperRegister(mapperLocation, applicationContext, resourceLoader);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public InfluxDbUtils influxDbUtils() {
|
||||
return new InfluxDbUtils(user, password, url, database, "autogen");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user