将终端台账拆分为pq&pms两类
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
//package com.njcn.influxdb.config;
|
||||
//
|
||||
///**
|
||||
// * @author hongawen
|
||||
// * @version 1.0.0
|
||||
// * @date 2022年09月20日 22:24
|
||||
// */
|
||||
//
|
||||
//import okhttp3.OkHttpClient;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//
|
||||
//@Configuration
|
||||
//public class InfluxDbOkHttpClientBuilderProvider implements org.springframework.boot.autoconfigure.influx.InfluxDbOkHttpClientBuilderProvider {
|
||||
//
|
||||
// @Override
|
||||
// public OkHttpClient.Builder get() {
|
||||
// // 设置超时时间为100秒
|
||||
// return new OkHttpClient.Builder()
|
||||
// .connectTimeout(100, TimeUnit.SECONDS)
|
||||
// .readTimeout(100, TimeUnit.SECONDS)
|
||||
// .writeTimeout(100, TimeUnit.SECONDS);
|
||||
// }
|
||||
//}
|
||||
@@ -12,7 +12,7 @@ public interface InfluxDBPublicParam {
|
||||
/**
|
||||
* influxDB数据库名称
|
||||
*/
|
||||
String DATABASE = "pqsbase";
|
||||
String DATABASE = "PQSBASE";
|
||||
|
||||
/**
|
||||
* 暂态事件汇总表
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.influxdb.utils;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.influxdb.InfluxDB;
|
||||
import org.influxdb.InfluxDB.ConsistencyLevel;
|
||||
import org.influxdb.InfluxDBFactory;
|
||||
@@ -31,6 +32,10 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
@Data
|
||||
public class InfluxDbUtils {
|
||||
static OkHttpClient.Builder client = new OkHttpClient.Builder()
|
||||
.connectTimeout(1000,TimeUnit.SECONDS)
|
||||
.readTimeout(1000, TimeUnit.SECONDS)
|
||||
.writeTimeout(1000, TimeUnit.SECONDS);
|
||||
private static final int FRACTION_MIN_WIDTH = 0;
|
||||
private static final int FRACTION_MAX_WIDTH = 9;
|
||||
private static final boolean ADD_DECIMAL_POINT = true;
|
||||
@@ -70,7 +75,7 @@ public class InfluxDbUtils {
|
||||
*/
|
||||
public InfluxDB influxDbBuild() {
|
||||
if (influxDB == null) {
|
||||
influxDB = InfluxDBFactory.connect(openurl, username, password);
|
||||
influxDB = InfluxDBFactory.connect(openurl, username, password,client);
|
||||
}
|
||||
try {
|
||||
// if (!influxDB.databaseExists(database)) {
|
||||
@@ -87,6 +92,8 @@ public class InfluxDbUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建数据库
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user