欧洲巴黎配置

This commit is contained in:
2025-07-11 17:16:10 +08:00
parent 2b70f531b4
commit e1cfe7f911
17 changed files with 511 additions and 764 deletions

View File

@ -10,7 +10,7 @@ spring:
username: nacos username: nacos
password: nacos password: nacos
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
#路由配置 #路由配置
gateway: gateway:
routes: routes:

View File

@ -17,11 +17,11 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true url: jdbc:mysql://172.31.35.125:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
username: zzkj username: business_db
password: zzkj@688737 password: zzkj@688737
druid: druid:
initialSize: 5 initialSize: 5
@ -33,7 +33,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 50000ms #连接超时 timeout: 50000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:
@ -50,8 +50,8 @@ spring:
minio: minio:
accessKey: admin accessKey: admin
secretKey: zzkj@688737 secretKey: zzkj@688737
endpoint: http://192.168.0.236:9000 endpoint: http://172.31.35.125:9000
prefixUrl: http://192.168.0.236:9000 prefixUrl: http://172.31.35.125:9000
formula: formula:
fieldmap: fieldmap:

View File

@ -1,233 +1,233 @@
package com.ho.datacollect.config; //package com.ho.datacollect.config;
//
import cn.hutool.core.util.IdUtil; //import cn.hutool.core.util.IdUtil;
import com.ho.datacollect.util.AnotherMqttConfigUtil; //import com.ho.datacollect.util.AnotherMqttConfigUtil;
import lombok.Data; //import lombok.Data;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.IMqttToken; //import org.eclipse.paho.client.mqttv3.IMqttToken;
import org.eclipse.paho.client.mqttv3.MqttClient; //import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions; //import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; //import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties; //import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//
/** ///**
* @author wp // * @author wp
* @desc: Mqtt配置类 // * @desc: Mqtt配置类
* @date 2025/06/11 // * @date 2025/06/11
*/ // */
@Configuration //@Configuration
@Data //@Data
@ConfigurationProperties("mqtt1") //@ConfigurationProperties("mqtt1")
@Slf4j //@Slf4j
public class AnotherMqttConfig { //public class AnotherMqttConfig {
//
//服务器url // //服务器url
@Value("${mqtt1.url}") // @Value("${mqtt1.url}")
String url; // String url;
//超时时间 // //超时时间
@Value("${mqtt1.timeout}") // @Value("${mqtt1.timeout}")
Integer timeout; // Integer timeout;
//会话保持时间 // //会话保持时间
@Value("${mqtt1.keepAlive}") // @Value("${mqtt1.keepAlive}")
Integer keepAlive; // Integer keepAlive;
//
@Value("${mqtt1.userName}") // @Value("${mqtt1.userName}")
String userName; // String userName;
//
@Value("${mqtt1.passWord}") // @Value("${mqtt1.passWord}")
String passWord; // String passWord;
//
@Value("${topic.edgeLoginRequest}") // @Value("${topic.edgeLoginRequest}")
String edgeLoginRequest; // String edgeLoginRequest;
//
@Value("${topic.edgeReadResponse}") // @Value("${topic.edgeReadResponse}")
String edgeReadResponse; // String edgeReadResponse;
//
@Value("${topic.edgeWriteResponse}") // @Value("${topic.edgeWriteResponse}")
String edgeWriteResponse; // String edgeWriteResponse;
//
@Value("${topic.edgeReportPush}") // @Value("${topic.edgeReportPush}")
String edgeReportPush; // String edgeReportPush;
//
@Value("${topic.edgeControlResponse}") // @Value("${topic.edgeControlResponse}")
String edgeControlResponse; // String edgeControlResponse;
//
@Autowired // @Autowired
AnotherLoginRequestConsumer loginRequestConsumer; // AnotherLoginRequestConsumer loginRequestConsumer;
//
@Autowired // @Autowired
AnotherReadResponseConsumer readResponseConsumer; // AnotherReadResponseConsumer readResponseConsumer;
//
@Autowired // @Autowired
AnotherWriteResponseConsumer writeResponseConsumer; // AnotherWriteResponseConsumer writeResponseConsumer;
//
@Autowired // @Autowired
AnotherReportPushConsumer reportPushConsumer; // AnotherReportPushConsumer reportPushConsumer;
//
@Autowired // @Autowired
AnotherControlResponseConsumer controlResponseConsumer; // AnotherControlResponseConsumer controlResponseConsumer;
//
//是否自动重连 实际环境要改为true // //是否自动重连 实际环境要改为true
private boolean autoReConnect = true; // private boolean autoReConnect = true;
//
//
//登录验证的监听 // //登录验证的监听
@Bean(name = "AnotherLoginRequest") // @Bean(name = "AnotherLoginRequest")
public MqttClient initLoginRequest() { // public MqttClient initLoginRequest() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" +clientId); // log.info("clientId:" +clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
options.setExecutorServiceTimeout(0); // options.setExecutorServiceTimeout(0);
//options.setAutomaticReconnect(autoReConnect); // //options.setAutomaticReconnect(autoReConnect);
client.setCallback(loginRequestConsumer); // client.setCallback(loginRequestConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("LoginRequestMqttClient建立连接{}", complete); // log.info("LoginRequestMqttClient建立连接{}", complete);
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getLoginRequestTopic(); // String[] topic = AnotherMqttConfigUtil.getLoginRequestTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
return client; // return client;
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
//
//读取文件请求的监听 // //读取文件请求的监听
@Bean(name = "AnotherReadResponse") // @Bean(name = "AnotherReadResponse")
public MqttClient initReadRequest() { // public MqttClient initReadRequest() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" +clientId); // log.info("clientId:" +clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
options.setExecutorServiceTimeout(0); // options.setExecutorServiceTimeout(0);
//options.setAutomaticReconnect(autoReConnect); // //options.setAutomaticReconnect(autoReConnect);
client.setCallback(readResponseConsumer); // client.setCallback(readResponseConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("ReadRequestMqttClient建立连接{}", complete); // log.info("ReadRequestMqttClient建立连接{}", complete);
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getReadRequestTopic(); // String[] topic = AnotherMqttConfigUtil.getReadRequestTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
//
//写文件响应的监听 // //写文件响应的监听
@Bean(name = "AnotherWriteResponse") // @Bean(name = "AnotherWriteResponse")
public MqttClient initWriteRequest() { // public MqttClient initWriteRequest() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" +clientId); // log.info("clientId:" +clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
options.setExecutorServiceTimeout(0); // options.setExecutorServiceTimeout(0);
//options.setAutomaticReconnect(autoReConnect); // //options.setAutomaticReconnect(autoReConnect);
client.setCallback(writeResponseConsumer); // client.setCallback(writeResponseConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("WriteRequestMqttClient建立连接{}", complete); // log.info("WriteRequestMqttClient建立连接{}", complete);
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getWriteRequestTopic(); // String[] topic = AnotherMqttConfigUtil.getWriteRequestTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
//
//报告上传 // //报告上传
@Bean(name = "AnotherReportPush") // @Bean(name = "AnotherReportPush")
public MqttClient initReportPush() { // public MqttClient initReportPush() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" +clientId); // log.info("clientId:" +clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
options.setExecutorServiceTimeout(0); // options.setExecutorServiceTimeout(0);
//options.setAutomaticReconnect(autoReConnect); // //options.setAutomaticReconnect(autoReConnect);
client.setCallback(reportPushConsumer); // client.setCallback(reportPushConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("ReportPushMqttClient建立连接{}", complete); // log.info("ReportPushMqttClient建立连接{}", complete);
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getReportPushTopic(); // String[] topic = AnotherMqttConfigUtil.getReportPushTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
//
//远程控制 // //远程控制
@Bean(name = "AnotherControlResponse") // @Bean(name = "AnotherControlResponse")
public MqttClient initControlResponse() { // public MqttClient initControlResponse() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" +clientId); // log.info("clientId:" +clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
options.setExecutorServiceTimeout(0); // options.setExecutorServiceTimeout(0);
//options.setAutomaticReconnect(autoReConnect); // //options.setAutomaticReconnect(autoReConnect);
client.setCallback(controlResponseConsumer); // client.setCallback(controlResponseConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("ControlResponseMqttClient建立连接{}", complete); // log.info("ControlResponseMqttClient建立连接{}", complete);
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getControlResponseTopic(); // String[] topic = AnotherMqttConfigUtil.getControlResponseTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
//
} //}

View File

@ -1,75 +1,75 @@
package com.ho.datacollect.util; //package com.ho.datacollect.util;
//
public class AnotherMqttConfigUtil { //public class AnotherMqttConfigUtil {
//
public static String[] commonTopic = new String[]{ // public static String[] commonTopic = new String[]{
"+/device/27d83a2844ff5866", // "+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a", // "+/device/77ba753718908d1a",
"1/device/+" // "1/device/+"
}; // };
//
/** // /**
* 获取登录验证的监听主题 // * 获取登录验证的监听主题
* @return // * @return
*/ // */
public static String[] getLoginRequestTopic(){ // public static String[] getLoginRequestTopic(){
String log = "/login/request"; // String log = "/login/request";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 读取文件请求的监听主题 // * 读取文件请求的监听主题
* @return // * @return
*/ // */
public static String[] getReadRequestTopic(){ // public static String[] getReadRequestTopic(){
String log = "/read/response"; // String log = "/read/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 写文件响应的监听主题 // * 写文件响应的监听主题
* @return // * @return
*/ // */
public static String[] getWriteRequestTopic(){ // public static String[] getWriteRequestTopic(){
String log = "/write/response"; // String log = "/write/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 获取数据上送监听主题 // * 获取数据上送监听主题
* @return // * @return
*/ // */
public static String[] getReportPushTopic(){ // public static String[] getReportPushTopic(){
String log = "/report/push"; // String log = "/report/push";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 获取远程控制主题 // * 获取远程控制主题
* @return // * @return
*/ // */
public static String[] getControlResponseTopic(){ // public static String[] getControlResponseTopic(){
String log = "/control/response"; // String log = "/control/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
} //}

View File

@ -3,132 +3,7 @@ package com.ho.datacollect.util;
public class MqttConfigUtil { public class MqttConfigUtil {
public static String[] commonTopic = new String[]{ public static String[] commonTopic = new String[]{
"+/device/fa22fd97b39c04c8", "1/device/+"
"+/device/803274d9432df350",
"+/device/e4067161c4ab1929",
"+/device/f0e9a01d8b98e820",
"+/device/f6c6c5b5dfcc73bb",
"+/device/9038222e7fb8789d",
"+/device/a707000000000000",
"+/device/811b4eb0f8e99c12",
"+/device/c2c574a5c691bf69",
"+/device/5265899ad223c157",
"+/device/517664ba87ac49ec",
"+/device/b602b10956119d39",
"+/device/4c7dd125b6da91fd",
"+/device/581bf6724737da0c",
"+/device/8a2396ad453891b1",
"+/device/917ca24a9ccdf809",
"+/device/a8402702a1d41d88",
"+/device/7a5202c7dc74afd6",
"+/device/bfe7a19ced50c54d",
"+/device/21f835330b485415",
"+/device/a978d559eeb0a32e",
"+/device/4dddf8b0caae7d8b",
"+/device/beff9c2ea2d210c4",
"+/device/a5af67550fd4dc50",
"+/device/0c3e8eadd58f8a51",
"+/device/14ed724c77b73494",
"+/device/d12d361c6bfef025",
"+/device/781c2bf41a6ffa5a",
"+/device/ac10829b20169da0",
"+/device/ec939740502f3a66",
"+/device/e0c812e00ac4e006",
"+/device/0000000000000000",
"+/device/5e9b285116453b1a",
"+/device/eeb34d0de2b6a953",
"+/device/56501a13712f9a6e",
"+/device/e8d98e91aaa7b04f",
"+/device/6c6978a7fb9a8f6d",
"+/device/6803ef0410fb7c02",
"+/device/fe828101e353b919",
"+/device/42ff4118453e41ca",
"+/device/d9f866f14483c92d",
"+/device/1deae4a5f1400666",
"+/device/a608ea4ffb5221d7",
"+/device/bd0ccfe06c1d3596",
"+/device/262cdfc279065aa0",
"+/device/3df87897c35ae0c5",
"+/device/8ca0297304c266b6",
"+/device/1200000000000000",
"+/device/333470f1dccfb19b",
"+/device/02bd28350b1c2619",
"+/device/9688431d4f01806e",
"+/device/a2f3973e0c3b4835",
"+/device/f91779c511763a5b",
"+/device/2b8924e509ee8559",
"+/device/9e4ee680a26303f7",
"+/device/56d9bb7131c724b5",
"+/device/9511bebccc477456",
"+/device/0a3146610bcc5440",
"+/device/e817466c6127ab44",
"+/device/99efbb96bc40fd15",
"+/device/43687f5b1ebecb64",
"+/device/b9e0cdfdd4df7736",
"+/device/ed76d5ab39f6c42d",
"+/device/63f8d5df0c9d647c",
"+/device/98b61a1f166b8419",
"+/device/201913c33e0318ee",
"+/device/9c74bebb12d05635",
"+/device/1f237999be964f42",
"+/device/104cebca14ffa98c",
"+/device/2d1cab6edbfaeb94",
"+/device/c8c30d1decff167d",
"+/device/984423fdfda19376",
"+/device/18db1248acf66a3e",
"+/device/e18710921a53bfff",
"+/device/04878a29f87e237d",
"+/device/c336512bd77d6cbc",
"+/device/01ac2a161029e555",
"+/device/4eeccb413407a4e4",
"+/device/14e7f5c9b123360d",
"+/device/daf25437cbc31a00",
"+/device/44dfc09110e1f994",
"+/device/2dd522056c132349",
"+/device/bd7f78f9d070abe6",
"+/device/e932c594ce083810",
"+/device/b80c3b7513773c7f",
"+/device/7f0d37c30d28ed0f",
"+/device/53be81deba3b9c74",
"+/device/fe5f56cc9029bf20",
"+/device/60723affac3821a5",
"+/device/d3e22616db04dc52",
"+/device/36c12afabd8fa201",
"+/device/71db70b8ce2eb0d1",
"+/device/69f319418cfe13a2",
"+/device/f043173d1fd8cb0d",
"+/device/9b5084678310c4da",
"+/device/fa3936fdeb8f8cd1",
"+/device/0819c35644808b72",
"+/device/40442c5a0a29de37",
"+/device/75fa0ee5048bd500",
"+/device/39674be356de68ad",
"+/device/b490b672a5f76716",
"+/device/6a3ba96ed146872b",
"+/device/3a785a63862c213d",
"+/device/2d29a0fbac938329",
"+/device/7d97391a68f8d6af",
"+/device/b50a1edd44549876",
"+/device/7c31d3c5c077228f",
"+/device/99e513be6075f8c6",
"+/device/5d4297256f02ebc2",
"+/device/67aa37e699e1e08f",
"+/device/ea0ebfbfa1487bd2",
"+/device/aa8a43d326dddb3f",
"+/device/82d40d7dbcfc884e",
"+/device/34ee15e05a3133bc",
"+/device/ee2508ba91664376",
"+/device/48c18f2a756dcc28",
"+/device/056d38ac91f61ffd",
"+/device/60f2bbbc054bfa03",
"+/device/50fdebcf6eb85a49",
"+/device/227a752b9bfb6b02",
"+/device/d60a05bcd086f160",
"+/device/f3c813d5e3d7fd99",
"+/device/cd6cb4a64b42bda5",
"+/device/436de647bbf01b22",
"+/device/e9eee97d793756fa",
"+/device/8c062827b5c1548b"
}; };
/** /**

View File

@ -11,9 +11,9 @@ swagger2:
#mqtt #mqtt
mqtt: mqtt:
url: tcp://123.60.190.77:1883 # hz线上环境MQTT url: tcp://172.31.9.103:1883
userName: admin userName: admin
passWord: public passWord: zzkj@688737
timeout: 5000 timeout: 5000
keepAlive: 60 keepAlive: 60
@ -47,11 +47,11 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai url: jdbc:mysql://172.31.35.125:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: zzkj username: business_db
password: zzkj@688737 password: zzkj@688737
druid: druid:
initialSize: 5 initialSize: 5
@ -63,7 +63,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 3000ms #连接超时 timeout: 3000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:
@ -76,8 +76,8 @@ spring:
minio: minio:
accessKey: admin accessKey: admin
secretKey: zzkj@688737 secretKey: zzkj@688737
endpoint: http://192.168.0.236:9000 endpoint: http://172.31.35.125:9000
prefixUrl: http://192.168.0.236:9000 prefixUrl: http://172.31.35.125:9000
#跳过登录true ,不跳过false #跳过登录true ,不跳过false
skipLogin: false skipLogin: false

View File

@ -1,75 +1,75 @@
package com.ho.filecenter.config; //package com.ho.filecenter.config;
//
import cn.hutool.core.util.IdUtil; //import cn.hutool.core.util.IdUtil;
import com.ho.filecenter.util.AnotherMqttConfigUtil; //import com.ho.filecenter.util.AnotherMqttConfigUtil;
import lombok.Data; //import lombok.Data;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.IMqttToken; //import org.eclipse.paho.client.mqttv3.IMqttToken;
import org.eclipse.paho.client.mqttv3.MqttClient; //import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions; //import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; //import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties; //import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
//
/** ///**
* @author wp // * @author wp
* @desc: Mqtt配置类 // * @desc: Mqtt配置类
* @date 2025/06/11 // * @date 2025/06/11
*/ // */
@Configuration //@Configuration
@Data //@Data
@ConfigurationProperties("mqtt1") //@ConfigurationProperties("mqtt1")
@Slf4j //@Slf4j
public class AnotherMqttConfig { //public class AnotherMqttConfig {
//
//服务器url // //服务器url
@Value("${mqtt1.url}") // @Value("${mqtt1.url}")
String url; // String url;
//超时时间 // //超时时间
@Value("${mqtt1.timeout}") // @Value("${mqtt1.timeout}")
Integer timeout; // Integer timeout;
//会话保持时间 // //会话保持时间
@Value("${mqtt1.keepAlive}") // @Value("${mqtt1.keepAlive}")
Integer keepAlive; // Integer keepAlive;
//
@Value("${mqtt1.userName}") // @Value("${mqtt1.userName}")
String userName; // String userName;
//
@Value("${mqtt1.passWord}") // @Value("${mqtt1.passWord}")
String passWord; // String passWord;
//
@Autowired // @Autowired
AnotherFileEdgeResponseConsumer fileEdgeResponseConsumer; // AnotherFileEdgeResponseConsumer fileEdgeResponseConsumer;
//
//文件响应 // //文件响应
@Bean(name = "AnotherFileEdgeResponse") // @Bean(name = "AnotherFileEdgeResponse")
public MqttClient initFileResponseClient() { // public MqttClient initFileResponseClient() {
String clientId = IdUtil.simpleUUID(); // String clientId = IdUtil.simpleUUID();
log.info("clientId:" + clientId); // log.info("clientId:" + clientId);
MqttClient client =null; // MqttClient client =null;
try { // try {
client = new MqttClient(url, clientId,null); // client = new MqttClient(url, clientId,null);
MqttConnectOptions options = new MqttConnectOptions(); // MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(userName); // options.setUserName(userName);
options.setPassword(passWord.toCharArray()); // options.setPassword(passWord.toCharArray());
options.setCleanSession(true); // options.setCleanSession(true);
options.setConnectionTimeout(timeout); // options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepAlive); // options.setKeepAliveInterval(keepAlive);
client.setCallback(fileEdgeResponseConsumer); // client.setCallback(fileEdgeResponseConsumer);
IMqttToken iMqttToken = client.connectWithResult(options); // IMqttToken iMqttToken = client.connectWithResult(options);
boolean complete = iMqttToken.isComplete(); // boolean complete = iMqttToken.isComplete();
log.info("FileResponseClient建立连接{}", complete); // log.info("FileResponseClient建立连接{}", complete);
//
//这里监听的是 // //这里监听的是
String[] topic = AnotherMqttConfigUtil.getFileResponseTopic(); // String[] topic = AnotherMqttConfigUtil.getFileResponseTopic();
int[] qos = new int[topic.length]; // int[] qos = new int[topic.length];
client.subscribe(topic,qos); // client.subscribe(topic,qos);
log.info("已订阅topic{}", topic); // log.info("已订阅topic{}", topic);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
return client; // return client;
} // }
} //}

View File

@ -157,13 +157,13 @@ public class FileController {
fileAttributeResp.setList(new ArrayList<>()); fileAttributeResp.setList(new ArrayList<>());
return DataResult.success(fileAttributeResp); return DataResult.success(fileAttributeResp);
} }
String serialNo = vo.getSerialNo(); // String serialNo = vo.getSerialNo();
List<String> snList = MqttConfigUtil.getSnList(); // List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){ // if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileAttributeResp = fileService.getFileAttribute(vo); fileAttributeResp = fileService.getFileAttribute(vo);
}else{ // }else{
fileAttributeResp = anotherFileService.getFileAttribute(vo); // fileAttributeResp = anotherFileService.getFileAttribute(vo);
} // }
return DataResult.success(fileAttributeResp); return DataResult.success(fileAttributeResp);
} }
@ -179,13 +179,13 @@ public class FileController {
fileDeleteResp.setMsg(msg + CommonConstant.Heartbeat.FAIL); fileDeleteResp.setMsg(msg + CommonConstant.Heartbeat.FAIL);
return DataResult.success(fileDeleteResp); return DataResult.success(fileDeleteResp);
} }
String serialNo = fileDeleteReqVO.getSerialNo(); // String serialNo = fileDeleteReqVO.getSerialNo();
List<String> snList = MqttConfigUtil.getSnList(); // List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){ // if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO); fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO);
}else{ // }else{
fileDeleteResp = anotherFileService.deleteDeviceFiles(fileDeleteReqVO); // fileDeleteResp = anotherFileService.deleteDeviceFiles(fileDeleteReqVO);
} // }
return DataResult.success(fileDeleteResp); return DataResult.success(fileDeleteResp);
} }
@ -210,12 +210,12 @@ public class FileController {
resp.setMsg(CommonConstant.Heartbeat.MSG + serialNo + CommonConstant.Heartbeat.SUCCESS); resp.setMsg(CommonConstant.Heartbeat.MSG + serialNo + CommonConstant.Heartbeat.SUCCESS);
resp.setHeartbeatStatus(CommonConstant.ONE); resp.setHeartbeatStatus(CommonConstant.ONE);
log.info("文件上传(向边端上传)开始上传"); log.info("文件上传(向边端上传)开始上传");
List<String> snList = MqttConfigUtil.getSnList(); // List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){ // if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileService.fileUploadForDevice(file, stationId, serialNo, filePath); fileService.fileUploadForDevice(file, stationId, serialNo, filePath);
}else{ // }else{
anotherFileService.fileUploadForDevice(file, stationId, serialNo, filePath); // anotherFileService.fileUploadForDevice(file, stationId, serialNo, filePath);
} // }
} }
return DataResult.success(resp); return DataResult.success(resp);
} }
@ -239,13 +239,13 @@ public class FileController {
resp.setHeartbeatStatus(CommonConstant.ONE); resp.setHeartbeatStatus(CommonConstant.ONE);
log.info("文件下载(从边端下载到云端)开始下载"); log.info("文件下载(从边端下载到云端)开始下载");
fileService.downloadFromDevice(fileForDeviceReqVO); fileService.downloadFromDevice(fileForDeviceReqVO);
String serialNo = fileForDeviceReqVO.getSerialNo(); // String serialNo = fileForDeviceReqVO.getSerialNo();
List<String> snList = MqttConfigUtil.getSnList(); // List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){ // if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileService.downloadFromDevice(fileForDeviceReqVO); fileService.downloadFromDevice(fileForDeviceReqVO);
}else{ // }else{
anotherFileService.downloadFromDevice(fileForDeviceReqVO); // anotherFileService.downloadFromDevice(fileForDeviceReqVO);
} // }
} }
return DataResult.success(resp); return DataResult.success(resp);
} }

View File

@ -1,66 +1,66 @@
package com.ho.filecenter.util; //package com.ho.filecenter.util;
//
import java.util.Arrays; //import java.util.Arrays;
import java.util.List; //import java.util.List;
//
public class AnotherMqttConfigUtil { //public class AnotherMqttConfigUtil {
//
public static String[] commonTopic = new String[]{ // public static String[] commonTopic = new String[]{
"+/device/27d83a2844ff5866", // "+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a", // "+/device/77ba753718908d1a",
"1/device/+" // "1/device/+"
}; // };
//
/** // /**
* 获取文件请求监听主题 // * 获取文件请求监听主题
* @return // * @return
*/ // */
public static String[] getFileRequestTopic(){ // public static String[] getFileRequestTopic(){
String log = "/file/request"; // String log = "/file/request";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 读取文件响应监听主题 // * 读取文件响应监听主题
* @return // * @return
*/ // */
public static String[] getFileResponseTopic(){ // public static String[] getFileResponseTopic(){
String log = "/file/response"; // String log = "/file/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
public static String[] getCurveResponseTopic(){ // public static String[] getCurveResponseTopic(){
String log = "/curve/response"; // String log = "/curve/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
public static String[] getDispatchResponseTopic(){ // public static String[] getDispatchResponseTopic(){
String log = "/dispatch/response"; // String log = "/dispatch/response";
String[] str = new String[commonTopic.length]; // String[] str = new String[commonTopic.length];
for (int i = 0; i < commonTopic.length; i++) { // for (int i = 0; i < commonTopic.length; i++) {
str[i] = commonTopic[i]+log; // str[i] = commonTopic[i]+log;
} // }
return str; // return str;
} // }
//
/** // /**
* 获取SN配置合集 // * 获取SN配置合集
* @return // * @return
*/ // */
public static List<String> getSnList(){ // public static List<String> getSnList(){
List<String> strings = Arrays.asList(commonTopic); // List<String> strings = Arrays.asList(commonTopic);
return strings; // return strings;
} // }
} //}

View File

@ -6,135 +6,7 @@ import java.util.List;
public class MqttConfigUtil { public class MqttConfigUtil {
public static String[] commonTopic = new String[]{ public static String[] commonTopic = new String[]{
"+/device/fa22fd97b39c04c8", "1/device/+"
"+/device/803274d9432df350",
"+/device/e4067161c4ab1929",
"+/device/f0e9a01d8b98e820",
"+/device/f6c6c5b5dfcc73bb",
"+/device/9038222e7fb8789d",
"+/device/a707000000000000",
"+/device/811b4eb0f8e99c12",
"+/device/c2c574a5c691bf69",
"+/device/5265899ad223c157",
"+/device/517664ba87ac49ec",
"+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a",
"+/device/b602b10956119d39",
"+/device/4c7dd125b6da91fd",
"+/device/581bf6724737da0c",
"+/device/8a2396ad453891b1",
"+/device/917ca24a9ccdf809",
"+/device/a8402702a1d41d88",
"+/device/7a5202c7dc74afd6",
"+/device/bfe7a19ced50c54d",
"+/device/21f835330b485415",
"+/device/a978d559eeb0a32e",
"+/device/4dddf8b0caae7d8b",
"+/device/beff9c2ea2d210c4",
"+/device/a5af67550fd4dc50",
"+/device/0c3e8eadd58f8a51",
"+/device/14ed724c77b73494",
"+/device/d12d361c6bfef025",
"+/device/781c2bf41a6ffa5a",
"+/device/ac10829b20169da0",
"+/device/ec939740502f3a66",
"+/device/e0c812e00ac4e006",
"+/device/0000000000000000",
"+/device/5e9b285116453b1a",
"+/device/eeb34d0de2b6a953",
"+/device/56501a13712f9a6e",
"+/device/e8d98e91aaa7b04f",
"+/device/6c6978a7fb9a8f6d",
"+/device/6803ef0410fb7c02",
"+/device/fe828101e353b919",
"+/device/42ff4118453e41ca",
"+/device/d9f866f14483c92d",
"+/device/1deae4a5f1400666",
"+/device/a608ea4ffb5221d7",
"+/device/bd0ccfe06c1d3596",
"+/device/262cdfc279065aa0",
"+/device/3df87897c35ae0c5",
"+/device/8ca0297304c266b6",
"+/device/1200000000000000",
"+/device/333470f1dccfb19b",
"+/device/02bd28350b1c2619",
"+/device/9688431d4f01806e",
"+/device/a2f3973e0c3b4835",
"+/device/f91779c511763a5b",
"+/device/2b8924e509ee8559",
"+/device/9e4ee680a26303f7",
"+/device/56d9bb7131c724b5",
"+/device/9511bebccc477456",
"+/device/0a3146610bcc5440",
"+/device/e817466c6127ab44",
"+/device/99efbb96bc40fd15",
"+/device/43687f5b1ebecb64",
"+/device/b9e0cdfdd4df7736",
"+/device/ed76d5ab39f6c42d",
"+/device/63f8d5df0c9d647c",
"+/device/98b61a1f166b8419",
"+/device/201913c33e0318ee",
"+/device/9c74bebb12d05635",
"+/device/1f237999be964f42",
"+/device/104cebca14ffa98c",
"+/device/2d1cab6edbfaeb94",
"+/device/c8c30d1decff167d",
"+/device/984423fdfda19376",
"+/device/18db1248acf66a3e",
"+/device/e18710921a53bfff",
"+/device/04878a29f87e237d",
"+/device/c336512bd77d6cbc",
"+/device/01ac2a161029e555",
"+/device/4eeccb413407a4e4",
"+/device/14e7f5c9b123360d",
"+/device/daf25437cbc31a00",
"+/device/44dfc09110e1f994",
"+/device/2dd522056c132349",
"+/device/bd7f78f9d070abe6",
"+/device/e932c594ce083810",
"+/device/b80c3b7513773c7f",
"+/device/7f0d37c30d28ed0f",
"+/device/53be81deba3b9c74",
"+/device/fe5f56cc9029bf20",
"+/device/60723affac3821a5",
"+/device/d3e22616db04dc52",
"+/device/36c12afabd8fa201",
"+/device/71db70b8ce2eb0d1",
"+/device/69f319418cfe13a2",
"+/device/f043173d1fd8cb0d",
"+/device/9b5084678310c4da",
"+/device/fa3936fdeb8f8cd1",
"+/device/0819c35644808b72",
"+/device/40442c5a0a29de37",
"+/device/75fa0ee5048bd500",
"+/device/39674be356de68ad",
"+/device/b490b672a5f76716",
"+/device/6a3ba96ed146872b",
"+/device/3a785a63862c213d",
"+/device/2d29a0fbac938329",
"+/device/7d97391a68f8d6af",
"+/device/b50a1edd44549876",
"+/device/7c31d3c5c077228f",
"+/device/99e513be6075f8c6",
"+/device/5d4297256f02ebc2",
"+/device/67aa37e699e1e08f",
"+/device/ea0ebfbfa1487bd2",
"+/device/aa8a43d326dddb3f",
"+/device/82d40d7dbcfc884e",
"+/device/34ee15e05a3133bc",
"+/device/ee2508ba91664376",
"+/device/48c18f2a756dcc28",
"+/device/056d38ac91f61ffd",
"+/device/60f2bbbc054bfa03",
"+/device/50fdebcf6eb85a49",
"+/device/227a752b9bfb6b02",
"+/device/d60a05bcd086f160",
"+/device/f3c813d5e3d7fd99",
"+/device/cd6cb4a64b42bda5",
"+/device/436de647bbf01b22",
"+/device/e9eee97d793756fa",
"+/device/8c062827b5c1548b"
}; };
/** /**

View File

@ -7,9 +7,9 @@ server:
#mqtt #mqtt
mqtt: mqtt:
url: tcp://123.60.190.77:1883 # hz线上环境MQTT url: tcp://172.31.9.103:1883
userName: admin userName: admin
passWord: public passWord: zzkj@688737
timeout: 5000 timeout: 5000
keepAlive: 60 keepAlive: 60
@ -58,10 +58,10 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/file_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true url: jdbc:mysql://172.31.35.125:3306/file_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
username: file_center_db username: file_center_db
password: zzkj@688737 password: zzkj@688737
druid: druid:
@ -80,7 +80,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 3000ms #连接超时 timeout: 3000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:
@ -93,6 +93,6 @@ spring:
minio: minio:
accessKey: admin accessKey: admin
secretKey: zzkj@688737 secretKey: zzkj@688737
endpoint: http://192.168.0.236:9000 endpoint: http://172.31.35.125:9000
prefixUrl: http://192.168.0.236:9000 prefixUrl: http://172.31.35.125:9000

View File

@ -14,10 +14,10 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/flow_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowMultiQueries=true url: jdbc:mysql://172.31.35.125:3306/flow_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowMultiQueries=true
username: flow_db username: flow_db
password: zzkj@688737 password: zzkj@688737
druid: druid:
@ -31,7 +31,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 300000ms #连接超时 timeout: 300000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:

View File

@ -11,11 +11,11 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://192.168.0.236:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8 url: jdbc:TAOS-RS://172.31.35.125:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
username: root username: root
password: taosdata password: taosdata
druid: druid:
@ -29,7 +29,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 3000ms #连接超时 timeout: 3000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0

View File

@ -18,10 +18,10 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/user_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai url: jdbc:mysql://172.31.35.125:3306/user_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: user_center_db username: user_center_db
password: zzkj@688737 password: zzkj@688737
druid: druid:
@ -38,7 +38,7 @@ spring:
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 3000ms #连接超时 timeout: 3000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:

View File

@ -8,7 +8,7 @@ management.health.mail.enabled=false
spring.application.name=xxl-job-admin spring.application.name=xxl-job-admin
###nacos ###nacos
spring.cloud.nacos.discovery.server-addr=192.168.0.142:8848 spring.cloud.nacos.discovery.server-addr=172.31.9.103:8848
### resources ### resources
spring.mvc.servlet.load-on-startup=0 spring.mvc.servlet.load-on-startup=0
spring.mvc.static-path-pattern=/static/** spring.mvc.static-path-pattern=/static/**
@ -26,7 +26,7 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
#mybatis.type-aliases-package=com.xxl.job.admin.core.model #mybatis.type-aliases-package=com.xxl.job.admin.core.model
### xxl-job, datasource ### xxl-job, datasource
spring.datasource.url=jdbc:mysql://192.168.0.236:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:mysql://172.31.35.125:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=xxl_job spring.datasource.username=xxl_job
spring.datasource.password=zzkj@688737 spring.datasource.password=zzkj@688737
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

View File

@ -2,7 +2,7 @@
<configuration debug="false" scan="true" scanPeriod="1 seconds"> <configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>logback</contextName> <contextName>logback</contextName>
<property name="log.path" value="/data/applogs/xxl-job/xxl-job-admin.log"/> <property name="log.path" value="/www/zzkjcloud/logs/xxl-job-admin/xxl-job-admin.log"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>

View File

@ -9,12 +9,12 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
server-addr: 192.168.0.142:8848 server-addr: 172.31.9.103:8848
#Redis #Redis
redis: redis:
port: 6379 #端口 port: 6379 #端口
timeout: 3000ms #连接超时 timeout: 3000ms #连接超时
host: 192.168.0.236 #单机 host: 172.31.35.125 #单机
password: zzkj@688737 password: zzkj@688737
database: 0 database: 0
lettuce: lettuce:
@ -33,6 +33,6 @@ xxl:
address: address:
ip: 127.0.0.1 ip: 127.0.0.1
port: 9999 port: 9999
logpath: /home/hocloud/logs/xxl-job/ logpath: /www/zzkjcloud/logs/xxl-job/
logretentiondays: 30 logretentiondays: 30