mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
更新图片
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 64 KiB |
@@ -6,9 +6,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://${DB_HOST}/${DB_NAME}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://{DB_HOST}/{DB_NAME}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: ${DB_USER}
|
username: {DB_USER}
|
||||||
password: ${DB_PASSWORD}
|
password: {DB_PASSWORD}
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@@ -133,7 +133,9 @@ public class ToolController extends BaseController {
|
|||||||
String[] clientInfo = clientid.split("&");
|
String[] clientInfo = clientid.split("&");
|
||||||
if (clientInfo.length != 2) {
|
if (clientInfo.length != 2) {
|
||||||
// 设备未加密认证
|
// 设备未加密认证
|
||||||
if (mqttConfig.getusername().equals(username) && mqttConfig.getpassword().equals(password)) {
|
String deviceNum = clientInfo[0];
|
||||||
|
Device device = deviceService.selectShortDeviceBySerialNumber(deviceNum);
|
||||||
|
if (device !=null && mqttConfig.getusername().equals(username) && mqttConfig.getpassword().equals(password)) {
|
||||||
System.out.println("-----------认证成功,clientId:" + clientid + "---------------");
|
System.out.println("-----------认证成功,clientId:" + clientid + "---------------");
|
||||||
return ResponseEntity.ok().body("ok");
|
return ResponseEntity.ok().body("ok");
|
||||||
}
|
}
|
||||||
@@ -204,12 +206,12 @@ public class ToolController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("mqtt钩子处理")
|
@ApiOperation("mqtt钩子处理")
|
||||||
@PostMapping("/mqtt/webhook")
|
@PostMapping("/mqtt/webhook")
|
||||||
public AjaxResult webHookProcess(@RequestBody MqttClientConnectModel model) {
|
public void webHookProcess(@RequestBody MqttClientConnectModel model) {
|
||||||
try {
|
try {
|
||||||
System.out.println("webhook:" + model.getAction());
|
System.out.println("webhook:" + model.getAction());
|
||||||
// 过滤服务端、web端和手机端
|
// 过滤服务端、web端和手机端
|
||||||
if (model.getClientid().startsWith("server") || model.getClientid().startsWith("web") || model.getClientid().startsWith("phone")) {
|
if (model.getClientid().startsWith("server") || model.getClientid().startsWith("web") || model.getClientid().startsWith("phone")) {
|
||||||
return AjaxResult.success();
|
return;
|
||||||
}
|
}
|
||||||
String[] clientInfo = model.getClientid().split("&");
|
String[] clientInfo = model.getClientid().split("&");
|
||||||
String deviceNum = clientInfo[0];
|
String deviceNum = clientInfo[0];
|
||||||
@@ -243,7 +245,6 @@ public class ToolController extends BaseController {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
log.error("发生错误:" + ex.getMessage());
|
log.error("发生错误:" + ex.getMessage());
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user