作者 钟来

模块整理

@@ -4,7 +4,10 @@ import com.ruoyi.common.utils.StringUtils; @@ -4,7 +4,10 @@ import com.ruoyi.common.utils.StringUtils;
4 4
5 import javax.servlet.http.HttpServletRequest; 5 import javax.servlet.http.HttpServletRequest;
6 import java.net.InetAddress; 6 import java.net.InetAddress;
  7 +import java.net.NetworkInterface;
  8 +import java.net.SocketException;
7 import java.net.UnknownHostException; 9 import java.net.UnknownHostException;
  10 +import java.util.Enumeration;
8 11
9 /** 12 /**
10 * 获取IP方法 13 * 获取IP方法
@@ -211,6 +214,33 @@ public class IpUtils @@ -211,6 +214,33 @@ public class IpUtils
211 return "127.0.0.1"; 214 return "127.0.0.1";
212 } 215 }
213 216
  217 + public static String getLocalHost()
  218 + {
  219 + StringBuffer stringBuffer = new StringBuffer();
  220 + try {
  221 + Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
  222 + while (interfaces.hasMoreElements()) {
  223 + NetworkInterface networkInterface = interfaces.nextElement();
  224 + Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
  225 + while (addresses.hasMoreElements()) {
  226 + InetAddress address = addresses.nextElement();
  227 + if (!address.isLoopbackAddress() && address.isSiteLocalAddress()) {
  228 + if(stringBuffer.length() != 0 )
  229 + {
  230 + stringBuffer.append(":");
  231 + }
  232 + stringBuffer.append(address.getHostAddress());
  233 + }
  234 + }
  235 + }
  236 + } catch (SocketException e) {
  237 + e.printStackTrace();
  238 + }
  239 + return stringBuffer.toString();
  240 + }
  241 + public static void main(String[] args) {
  242 + System.out.println(getLocalHost());
  243 + }
214 /** 244 /**
215 * 获取主机名 245 * 获取主机名
216 * 246 *
@@ -63,7 +63,6 @@ @@ -63,7 +63,6 @@
63 <dependency> 63 <dependency>
64 <groupId>mysql</groupId> 64 <groupId>mysql</groupId>
65 <artifactId>mysql-connector-java</artifactId> 65 <artifactId>mysql-connector-java</artifactId>
66 - <version>8.0.17</version>  
67 </dependency> 66 </dependency>
68 </dependencies> 67 </dependencies>
69 </project> 68 </project>
@@ -47,8 +47,16 @@ public class DecimalModelOutput extends ThingsModelItemBase<BigDecimal> @@ -47,8 +47,16 @@ public class DecimalModelOutput extends ThingsModelItemBase<BigDecimal>
47 @Override 47 @Override
48 public boolean checkValue() { 48 public boolean checkValue() {
49 BigDecimal bigDecimal = getValue(); 49 BigDecimal bigDecimal = getValue();
50 - if(null != bigDecimal && bigDecimal.compareTo(min)>=0 && bigDecimal.compareTo(max)<=0) 50 + if(null != bigDecimal)
51 { 51 {
  52 + if(null != min && bigDecimal.compareTo(min)<0)
  53 + {
  54 + return false;
  55 + }
  56 + if(null != max && bigDecimal.compareTo(max)>0)
  57 + {
  58 + return false;
  59 + }
52 return true; 60 return true;
53 } 61 }
54 return false; 62 return false;
@@ -64,11 +64,18 @@ public class IntegerModelOutput extends ThingsModelItemBase<Integer> @@ -64,11 +64,18 @@ public class IntegerModelOutput extends ThingsModelItemBase<Integer>
64 { 64 {
65 BigDecimal bigDecimal = new BigDecimal(getValue()); 65 BigDecimal bigDecimal = new BigDecimal(getValue());
66 66
67 - if(bigDecimal.compareTo(min)>=0 && bigDecimal.compareTo(max)<=0) 67 + if(null != bigDecimal)
68 { 68 {
  69 + if(null != min && bigDecimal.compareTo(min)<0)
  70 + {
  71 + return false;
  72 + }
  73 + if(null != max && bigDecimal.compareTo(max)>0)
  74 + {
  75 + return false;
  76 + }
69 return true; 77 return true;
70 } 78 }
71 -  
72 } 79 }
73 return false; 80 return false;
74 } 81 }
@@ -130,20 +130,23 @@ public class BusinessDataUpdateService { @@ -130,20 +130,23 @@ public class BusinessDataUpdateService {
130 device.setSummary(summaryObjec.toString()); 130 device.setSummary(summaryObjec.toString());
131 } 131 }
132 132
133 - SaveDataDto saveDataDto = dataModeAnalysisService.analysisThingsModelValue( olddevice.getClient_id(),olddevice.getMqtt_username(),jsData,serverDto);  
134 - //更新数据  
135 - if(null != olddevice && ("ADD".equals(type.name())|| "READ".equals(type.name()))) 133 + if(null != jsData && jsData.size() != 0)
136 { 134 {
137 - String str = olddevice.getThings_model_value();  
138 - String newStr = deviceService.getNewAdddate(device.getClient_id(),str,saveDataDto.getData(),serverDto.getLogDeviceOperationList(),operationType,isLog).toJSONString();  
139 - device.setThings_model_value(newStr);  
140 - }else{  
141 - device.setThings_model_value(saveDataDto.getData().toJSONString()); 135 + SaveDataDto saveDataDto = dataModeAnalysisService.analysisThingsModelValue( olddevice.getClient_id(),olddevice.getMqtt_username(),jsData,serverDto);
  136 + //更新数据
  137 + if(null != olddevice && ("ADD".equals(type.name())|| "READ".equals(type.name())))
  138 + {
  139 + String str = olddevice.getThings_model_value();
  140 + String newStr = deviceService.getNewAdddate(device.getClient_id(),str,saveDataDto.getData(),serverDto.getLogDeviceOperationList(),operationType,isLog).toJSONString();
  141 + device.setThings_model_value(newStr);
  142 + }else{
  143 + device.setThings_model_value(saveDataDto.getData().toJSONString());
  144 + }
  145 + //配置只做增量
  146 + String str = (null!=olddevice?olddevice.getThings_model_config():null);
  147 + String newStr = deviceService.getNewAdddate(device.getClient_id(),str,saveDataDto.getConfig(),serverDto.getLogDeviceOperationList(),operationType,isLog).toJSONString();
  148 + device.setThings_model_config(newStr);
142 } 149 }
143 - //配置只做增量  
144 - String str = (null!=olddevice?olddevice.getThings_model_config():null);  
145 - String newStr = deviceService.getNewAdddate(device.getClient_id(),str,saveDataDto.getConfig(),serverDto.getLogDeviceOperationList(),operationType,isLog).toJSONString();  
146 - device.setThings_model_config(newStr);  
147 150
148 return device; 151 return device;
149 } 152 }
1 #!/bin/bash 1 #!/bin/bash
2 # 如果编码格式有问题执行:sed -i 's/\r$//' guard.sh 2 # 如果编码格式有问题执行:sed -i 's/\r$//' guard.sh
  3 +# 执行脚本: nohup /bin/bash /opt/lh-smart-feeder/lh-smart-feeder/guard.sh >/dev/null 2>&1 &
3 # 定义要检查的 JAR 文件名和启动命令 4 # 定义要检查的 JAR 文件名和启动命令
4 JAR_FILE="lh-smart-feeder.jar" 5 JAR_FILE="lh-smart-feeder.jar"
5 START_COMMAND="java -jar $JAR_FILE" 6 START_COMMAND="java -jar $JAR_FILE"
@@ -11,14 +12,23 @@ is_running() { @@ -11,14 +12,23 @@ is_running() {
11 12
12 # 启动 JAR 程序 13 # 启动 JAR 程序
13 start_program() { 14 start_program() {
14 - /opt/lh-smart-feeder/lh-smart-feeder/start.sh 15 + cd /opt/lh-smart-feeder/lh-smart-feeder/
  16 + ./start.sh
15 } 17 }
16 18
17 -# 检查 JAR 程序是否在运行  
18 -if ! is_running; then  
19 - echo "JAR程序未启动,将在3秒后自动启动..."  
20 - sleep 3  
21 - start_program  
22 -else  
23 - echo "JAR程序已启动"  
24 -fi 19 +stop=0
  20 +
  21 +trap "stop=1" SIGINT SIGTERM
  22 +
  23 +while [ $stop -eq 0 ]; do
  24 + # 检查 JAR 程序是否在运行
  25 + if ! is_running; then
  26 + echo "JAR程序未启动,将在3秒后自动启动..."
  27 + sleep 3
  28 + start_program
  29 + else
  30 + echo "JAR程序已启动"
  31 + fi
  32 + sleep 5
  33 +done
  34 +
@@ -127,6 +127,20 @@ public class CameraService { @@ -127,6 +127,20 @@ public class CameraService {
127 logger.info("关闭摄像头"); 127 logger.info("关闭摄像头");
128 } 128 }
129 129
  130 + /**
  131 + * 释放资源
  132 + */
  133 + public void clean()
  134 + {
  135 + if(videoIsOpen)
  136 + {
  137 + videoIsOpen = false;
  138 + // 释放资源
  139 + videoCapture.release();
  140 + }
  141 + }
  142 +
  143 +
130 public VideoCapture getVideoCapture() { 144 public VideoCapture getVideoCapture() {
131 return videoCapture; 145 return videoCapture;
132 } 146 }
@@ -24,6 +24,7 @@ import java.util.ArrayList; @@ -24,6 +24,7 @@ import java.util.ArrayList;
24 import java.util.Arrays; 24 import java.util.Arrays;
25 import java.util.List; 25 import java.util.List;
26 import java.util.concurrent.ScheduledExecutorService; 26 import java.util.concurrent.ScheduledExecutorService;
  27 +import java.util.concurrent.ScheduledFuture;
27 import java.util.concurrent.TimeUnit; 28 import java.util.concurrent.TimeUnit;
28 29
29 /** 30 /**
@@ -147,11 +148,22 @@ public class FishGroupImageRecognitionService { @@ -147,11 +148,22 @@ public class FishGroupImageRecognitionService {
147 // 逐帧处理视频 148 // 逐帧处理视频
148 Mat frame = new Mat(); 149 Mat frame = new Mat();
149 scheduledExecutorService.scheduleWithFixedDelay(() -> { 150 scheduledExecutorService.scheduleWithFixedDelay(() -> {
150 - logger.info("逐帧处理视频");  
151 - if (((Boolean)configurationParameterService.getConfig(ConfigurationParameter.FishGroupImageRecognition)) && videoCapture.read(frame)) {  
152 - logger.info("开始逐帧处理视频"); 151 + Boolean fishGroupImageRecognition = ((Boolean)configurationParameterService.getConfig(ConfigurationParameter.FishGroupImageRecognition));
  152 + Boolean isread = videoCapture.read(frame);
  153 + logger.info("逐帧处理视频,开始处理的判断参数:鱼群图像识别是否开启 {}、摄像头是否可读取 {}",fishGroupImageRecognition,isread);
  154 + if(!isread )
  155 + {
  156 + logger.info("摄像头不可读取");
  157 + if(cameraService.getVideoIsOpen())
  158 + {
  159 + logger.info("重新初始化");
  160 + cameraService.clean();
  161 + }
  162 + return;
  163 +
  164 + }
  165 + if (fishGroupImageRecognition && isread) {
153 identify(frame,largestContour); 166 identify(frame,largestContour);
154 - logger.info("结束逐帧处理视频");  
155 } 167 }
156 },0,time, TimeUnit.MILLISECONDS); 168 },0,time, TimeUnit.MILLISECONDS);
157 169
@@ -22,9 +22,6 @@ public class InitService { @@ -22,9 +22,6 @@ public class InitService {
22 private DeviceService deviceService; 22 private DeviceService deviceService;
23 23
24 @Autowired 24 @Autowired
25 - private EhCacheService ehCacheService;  
26 -  
27 - @Autowired  
28 private FishGroupImageRecognitionService fishGroupImageRecognitionService; 25 private FishGroupImageRecognitionService fishGroupImageRecognitionService;
29 26
30 @Autowired 27 @Autowired
@@ -7,6 +7,7 @@ import com.zhonglai.luhui.smart.feeder.dto.commd.FeederCommd06Response; @@ -7,6 +7,7 @@ import com.zhonglai.luhui.smart.feeder.dto.commd.FeederCommd06Response;
7 import com.zhonglai.luhui.smart.feeder.dto.commd.FeederCommdDto; 7 import com.zhonglai.luhui.smart.feeder.dto.commd.FeederCommdDto;
8 import com.zhonglai.luhui.smart.feeder.dto.commd.FeederTimer; 8 import com.zhonglai.luhui.smart.feeder.dto.commd.FeederTimer;
9 import com.zhonglai.luhui.smart.feeder.util.FeederCommdUtil; 9 import com.zhonglai.luhui.smart.feeder.util.FeederCommdUtil;
  10 +import com.zhonglai.luhui.smart.feeder.util.PenetrateUtil;
10 import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; 11 import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
11 import org.eclipse.paho.client.mqttv3.MqttCallbackExtended; 12 import org.eclipse.paho.client.mqttv3.MqttCallbackExtended;
12 import org.eclipse.paho.client.mqttv3.MqttException; 13 import org.eclipse.paho.client.mqttv3.MqttException;
@@ -84,10 +85,33 @@ public class MqttCallback implements MqttCallbackExtended { @@ -84,10 +85,33 @@ public class MqttCallback implements MqttCallbackExtended {
84 } 85 }
85 } 86 }
86 } 87 }
  88 + else if(jsonObject.has("armbian"))
  89 + {
  90 + JsonObject armbian = jsonObject.get("armbian").getAsJsonObject();
  91 + for (String key:armbian.keySet())
  92 + {
  93 + switch (key)
  94 + {
  95 + case "penetrate":
  96 + int penetrate = armbian.get("penetrate").getAsInt();
  97 + switch (penetrate)
  98 + {
  99 + case 0:
  100 + PenetrateUtil.stop();
  101 + break;
  102 + case 1:
  103 + PenetrateUtil.start();
  104 + break;
  105 + }
  106 + break;
  107 + }
  108 + }
  109 + }
87 } 110 }
88 } 111 }
89 } 112 }
90 113
  114 +
91 @Override 115 @Override
92 public void deliveryComplete(IMqttDeliveryToken token) { 116 public void deliveryComplete(IMqttDeliveryToken token) {
93 // 成功发出消息 117 // 成功发出消息
@@ -58,7 +58,7 @@ public class TerminalService { @@ -58,7 +58,7 @@ public class TerminalService {
58 Map<String,Object> dmap = new HashMap<>(); 58 Map<String,Object> dmap = new HashMap<>();
59 Map<String,Object> map = new HashMap<>(); 59 Map<String,Object> map = new HashMap<>();
60 dmap.put("summary",map); 60 dmap.put("summary",map);
61 - map.put("localhostIp",IpUtils.getHostIp()); 61 + map.put("localhostIp",IpUtils.getLocalHost());
62 JSONObject jsonObject = new JSONObject(); 62 JSONObject jsonObject = new JSONObject();
63 jsonObject.put("0",dmap); 63 jsonObject.put("0",dmap);
64 String topic = "ADD_POST"; 64 String topic = "ADD_POST";
  1 +package com.zhonglai.luhui.smart.feeder.util;
  2 +
  3 +import cn.hutool.core.util.RuntimeUtil;
  4 +
  5 +public class PenetrateUtil {
  6 + public static void start()
  7 + {
  8 + RuntimeUtil.execForStr("/bin/sh","-c","cd /opt/lh-smart-feeder/frp_0.51.0_linux_arm64;./frpc -c ./frpc.ini");
  9 + System.out.println("frpc已启动");
  10 + }
  11 +
  12 + public static void stop()
  13 + {
  14 + String checkCommand = "ps -ef | grep frpc";
  15 + String checkResult = RuntimeUtil.execForStr("/bin/sh","-c",checkCommand);
  16 +
  17 + if (checkResult.contains("frpc")) {
  18 + String killCommand = "kill -9 $(ps -ef | grep frpc | grep -v grep | awk '{print $2}')";
  19 + RuntimeUtil.execForStr("/bin/sh","-c",killCommand);
  20 + System.out.println("frpc进程已被杀死");
  21 + } else {
  22 + System.out.println("frpc未在运行");
  23 + }
  24 + }
  25 +}
1 -# 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8064 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* sys: staticPath: "file:/opt/lh-smart-feeder/lh-smart-feeder/html/" cacheFilePath: "E:/opt/lh-smart-feeder/lh-smart-feeder/cache/" # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain,com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # 数据源配置 spring: # autoconfigure: # exclude: org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: org.sqlite.JDBC druid: # 主库数据源 master: url: jdbc:sqlite:db/my.db username: password: # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false url: username: password: # 初始连接数 initialSize: 5 # 最小连接池数量 minIdle: 10 # 最大连接池数量 maxActive: 20 # 配置获取连接等待超时的时间 maxWait: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 # 配置一个连接在池中最大生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置检测连接是否有效 validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false webStatFilter: enabled: true statViewServlet: enabled: true # 设置白名单,不填则允许所有访问 allow: url-pattern: /druid/* # 控制台管理用户名和密码 login-username: ruoyi login-password: 123456 filter: stat: enabled: true # 慢SQL记录 log-slow-sql: true slow-sql-millis: 1000 merge-sql: true wall: config: multi-statement-allow: true ## 数据源配置 #spring: # datasource: # type: com.alibaba.druid.pool.DruidDataSource # driverClassName: com.mysql.cj.jdbc.Driver # druid: # # 主库数据源 # master: # url: jdbc:mysql://rm-wz9740un21f09iokuao.mysql.rds.aliyuncs.com:3306/mqtt_broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: luhui # password: Luhui586 # # 从库数据源 # slave: # # 从数据源开关/默认关闭 # enabled: true # url: jdbc:mysql://119.23.218.181:3306/lh-server-ops?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: luhui # password: Luhui586 # # 初始连接数 # initialSize: 5 # # 最小连接池数量 # minIdle: 10 # # 最大连接池数量 # maxActive: 20 # # 配置获取连接等待超时的时间 # maxWait: 60000 # # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # timeBetweenEvictionRunsMillis: 60000 # # 配置一个连接在池中最小生存的时间,单位是毫秒 # minEvictableIdleTimeMillis: 300000 # # 配置一个连接在池中最大生存的时间,单位是毫秒 # maxEvictableIdleTimeMillis: 900000 # # 配置检测连接是否有效 # validationQuery: SELECT 1 FROM DUAL # testWhileIdle: true # testOnBorrow: false # testOnReturn: false # webStatFilter: # enabled: true # statViewServlet: # enabled: true # # 设置白名单,不填则允许所有访问 # allow: # url-pattern: /druid/* # # 控制台管理用户名和密码 # login-username: ruoyi # login-password: 123456 # filter: # stat: # enabled: true # # 慢SQL记录 # log-slow-sql: true # slow-sql-millis: 1000 # merge-sql: true # wall: # config: # multi-statement-allow: true mqtt: #链接地址 broker: tcp://175.24.61.68:1883 #唯一标识 clientId: 70094a59d1d991d #公司id roleid: 2 mqtt_usernames: 12_ZNZY #订阅的topic topics: PUT/+,GET_REQ/+, READ/+,POST_REQ/+ username: 12_ZNZY password: Luhui586 client: #客户端操作时间 operationTime: 10  
  1 +# 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8064 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* sys: staticPath: "file:/opt/lh-smart-feeder/lh-smart-feeder/html/" # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain,com.zhonglai.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # 数据源配置 spring: # autoconfigure: # exclude: org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: org.sqlite.JDBC druid: # 主库数据源 master: url: jdbc:sqlite:db/my.db username: password: # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false url: username: password: # 初始连接数 initialSize: 5 # 最小连接池数量 minIdle: 10 # 最大连接池数量 maxActive: 20 # 配置获取连接等待超时的时间 maxWait: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 # 配置一个连接在池中最大生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置检测连接是否有效 validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false webStatFilter: enabled: true statViewServlet: enabled: true # 设置白名单,不填则允许所有访问 allow: url-pattern: /druid/* # 控制台管理用户名和密码 login-username: ruoyi login-password: 123456 filter: stat: enabled: true # 慢SQL记录 log-slow-sql: true slow-sql-millis: 1000 merge-sql: true wall: config: multi-statement-allow: true ## 数据源配置 #spring: # datasource: # type: com.alibaba.druid.pool.DruidDataSource # driverClassName: com.mysql.cj.jdbc.Driver # druid: # # 主库数据源 # master: # url: jdbc:mysql://rm-wz9740un21f09iokuao.mysql.rds.aliyuncs.com:3306/mqtt_broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: luhui # password: Luhui586 # # 从库数据源 # slave: # # 从数据源开关/默认关闭 # enabled: true # url: jdbc:mysql://119.23.218.181:3306/lh-server-ops?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # username: luhui # password: Luhui586 # # 初始连接数 # initialSize: 5 # # 最小连接池数量 # minIdle: 10 # # 最大连接池数量 # maxActive: 20 # # 配置获取连接等待超时的时间 # maxWait: 60000 # # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # timeBetweenEvictionRunsMillis: 60000 # # 配置一个连接在池中最小生存的时间,单位是毫秒 # minEvictableIdleTimeMillis: 300000 # # 配置一个连接在池中最大生存的时间,单位是毫秒 # maxEvictableIdleTimeMillis: 900000 # # 配置检测连接是否有效 # validationQuery: SELECT 1 FROM DUAL # testWhileIdle: true # testOnBorrow: false # testOnReturn: false # webStatFilter: # enabled: true # statViewServlet: # enabled: true # # 设置白名单,不填则允许所有访问 # allow: # url-pattern: /druid/* # # 控制台管理用户名和密码 # login-username: ruoyi # login-password: 123456 # filter: # stat: # enabled: true # # 慢SQL记录 # log-slow-sql: true # slow-sql-millis: 1000 # merge-sql: true # wall: # config: # multi-statement-allow: true mqtt: #链接地址 broker: tcp://175.24.61.68:1883 #唯一标识 clientId: 70094a59d1d991d #公司id roleid: 2 mqtt_usernames: 12_ZNZY #订阅的topic topics: PUT/+,GET_REQ/+, READ/+,POST_REQ/+ username: 12_ZNZY password: Luhui586 client: #客户端操作时间 operationTime: 10
@@ -493,6 +493,12 @@ @@ -493,6 +493,12 @@
493 <artifactId>chatgpt-java</artifactId> 493 <artifactId>chatgpt-java</artifactId>
494 <version>1.0.12</version> 494 <version>1.0.12</version>
495 </dependency> 495 </dependency>
  496 +
  497 + <dependency>
  498 + <groupId>mysql</groupId>
  499 + <artifactId>mysql-connector-java</artifactId>
  500 + <version>8.0.17</version>
  501 + </dependency>
496 </dependencies> 502 </dependencies>
497 503
498 504