Commit c1508a35 authored by zhuangzhuang's avatar zhuangzhuang

修改influxdb,redis配置

parent 77d2e65f
...@@ -16,6 +16,7 @@ import org.influxdb.dto.QueryResult; ...@@ -16,6 +16,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -52,7 +53,9 @@ public class ScheduleConfig { ...@@ -52,7 +53,9 @@ public class ScheduleConfig {
@Autowired @Autowired
private InfluxDBTemplate influxDBTemplate; private InfluxDBTemplate influxDBTemplate;
private final static String database ="original";
@Value("${spring.influxdb.database}")
private static String database ;
List<Object> head = new ArrayList<Object>(){{ List<Object> head = new ArrayList<Object>(){{
add("时间"); add("时间");
......
...@@ -21,6 +21,7 @@ import org.apache.shiro.SecurityUtils; ...@@ -21,6 +21,7 @@ import org.apache.shiro.SecurityUtils;
import org.influxdb.dto.Query; import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -52,7 +53,9 @@ public class AlarmDataController { ...@@ -52,7 +53,9 @@ public class AlarmDataController {
@Autowired @Autowired
private TokenRedisService tokenRedisService; private TokenRedisService tokenRedisService;
private final static String database ="original";
@Value("${spring.influxdb.database}")
private static String database ;
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
......
...@@ -64,7 +64,9 @@ public class AlarmLogController { ...@@ -64,7 +64,9 @@ public class AlarmLogController {
@Autowired @Autowired
private WarehouseAlarmLogService warehouseAlarmLogService; private WarehouseAlarmLogService warehouseAlarmLogService;
private final static String database ="original";
@Value("${spring.influxdb.database}")
private static String database ;
@Value("${mqtt.userName}") @Value("${mqtt.userName}")
private String userName; private String userName;
......
...@@ -21,6 +21,7 @@ import org.influxdb.dto.QueryResult; ...@@ -21,6 +21,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -98,7 +99,8 @@ public class CircuitController { ...@@ -98,7 +99,8 @@ public class CircuitController {
@Autowired @Autowired
private TopicConfigService topicConfigService; private TopicConfigService topicConfigService;
private final static String database ="original"; @Value("${spring.influxdb.database}")
private static String database ;
//获取本公司的线路信息 //获取本公司的线路信息
@ApiOperation(value = "获取本公司的线路信息",notes = "获取本公司的线路信息,返回值说明:" + @ApiOperation(value = "获取本公司的线路信息",notes = "获取本公司的线路信息,返回值说明:" +
......
...@@ -30,6 +30,7 @@ import org.influxdb.dto.QueryResult; ...@@ -30,6 +30,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -83,7 +84,8 @@ public class DataController { ...@@ -83,7 +84,8 @@ public class DataController {
@Autowired @Autowired
private I18nController i18n; private I18nController i18n;
private final static String database = "original"; @Value("${spring.influxdb.database}")
private static String database ;
private List<String> list = new ArrayList<String>() {{ private List<String> list = new ArrayList<String>() {{
add("\"T\""); add("\"T\"");
......
...@@ -22,6 +22,7 @@ import org.influxdb.dto.QueryResult; ...@@ -22,6 +22,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -61,7 +62,8 @@ public class DownloadController { ...@@ -61,7 +62,8 @@ public class DownloadController {
@Autowired @Autowired
private TDLLogService tdlLogService; private TDLLogService tdlLogService;
private final static String database ="original"; @Value("${spring.influxdb.database}")
private static String database ;
@ApiOperation(value = "仓库数据下载",notes = "仓库数据下载") @ApiOperation(value = "仓库数据下载",notes = "仓库数据下载")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -19,6 +19,7 @@ import org.influxdb.dto.QueryResult; ...@@ -19,6 +19,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -65,7 +66,8 @@ public class HomePageController { ...@@ -65,7 +66,8 @@ public class HomePageController {
@Autowired @Autowired
private WarehouseAlarmLogService warehouseAlarmLogService; private WarehouseAlarmLogService warehouseAlarmLogService;
private final static String database ="original"; @Value("${spring.influxdb.database}")
private static String database ;
@Autowired @Autowired
private I18nController i18n; private I18nController i18n;
......
...@@ -26,6 +26,7 @@ import org.influxdb.dto.QueryResult; ...@@ -26,6 +26,7 @@ import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.influxdb.InfluxDBTemplate; import org.springframework.data.influxdb.InfluxDBTemplate;
import org.springframework.expression.spel.ast.NullLiteral; import org.springframework.expression.spel.ast.NullLiteral;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -84,7 +85,10 @@ public class WarehouseController { ...@@ -84,7 +85,10 @@ public class WarehouseController {
@Autowired @Autowired
private WarehouseAlarmLogService warehouseAlarmLogService; private WarehouseAlarmLogService warehouseAlarmLogService;
private final static String database ="original";
@Value("${spring.influxdb.database}")
private static String database ;
......
...@@ -9,12 +9,14 @@ tdl.core.add =http://logistics-core:8079/witium/addMount ...@@ -9,12 +9,14 @@ tdl.core.add =http://logistics-core:8079/witium/addMount
tdl.core.delete =http://logistics-core:8079/witium/delMount tdl.core.delete =http://logistics-core:8079/witium/delMount
tdl.redis.host = witcloud-redis tdl.redis.host = logistics-redis
tdl.redis.password=Witium37774020
server.port=8092 server.port=8092
# InfluxDB # InfluxDB
spring.influxdb.url=http://witcloud-influxdb:8086 spring.influxdb.url=http://ts-bp1q738i505oj79t7.influxdata.tsdb.aliyuncs.com:8086
spring.influxdb.database=logistics
tdl.mqtt.url = ssl://47.96.128.181 tdl.mqtt.url = ssl://47.96.128.181
tdl.mqtt.port = 8883 tdl.mqtt.port = 8883
......
...@@ -7,8 +7,6 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver ...@@ -7,8 +7,6 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver
threadpool.corepoolsize = 30 threadpool.corepoolsize = 30
threadpool.maxpoolsize = 50 threadpool.maxpoolsize = 50
server.port=8092 server.port=8092
management.security.enabled=false management.security.enabled=false
...@@ -56,8 +54,6 @@ tdl.mqtt.clientpwd = ...@@ -56,8 +54,6 @@ tdl.mqtt.clientpwd =
spring.influxdb.username=admin spring.influxdb.username=admin
spring.influxdb.password=37774020 spring.influxdb.password=37774020
spring.influxdb.url=http://47.97.184.225:8086 spring.influxdb.url=http://47.97.184.225:8086
#spring.influxdb.url=http://47.110.153.44:8086
#spring.influxdb.url=http://172.16.1.24:8086
spring.influxdb.database=original spring.influxdb.database=original
spring.influxdb.retentionPolicy = tdl_policy spring.influxdb.retentionPolicy = tdl_policy
spring.influxdb.connent-timeout=10 spring.influxdb.connent-timeout=10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment