From d783890b7c21534e28ba3050adf633acaffd12df Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 29 Jun 2025 20:49:51 +0800 Subject: [PATCH] =?UTF-8?q?review=EF=BC=9A=E3=80=90IoT=20=E7=89=A9?= =?UTF-8?q?=E8=81=94=E7=BD=91=E3=80=91=E4=B8=BA=20EMQX=20=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E6=B7=BB=E5=8A=A0=20=E5=85=B1=E4=BA=AB=20=E7=9A=84=20?= =?UTF-8?q?Vertx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/gateway/protocol/emqx/IotEmqxUpstreamProtocol.java | 2 +- .../gateway/protocol/emqx/router/IotEmqxDownstreamHandler.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/IotEmqxUpstreamProtocol.java b/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/IotEmqxUpstreamProtocol.java index fef3ce1723..9e6631af64 100644 --- a/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/IotEmqxUpstreamProtocol.java +++ b/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/IotEmqxUpstreamProtocol.java @@ -31,7 +31,7 @@ public class IotEmqxUpstreamProtocol { private volatile boolean isRunning = false; - private Vertx vertx; + private final Vertx vertx; @Getter private final String serverId; diff --git a/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/router/IotEmqxDownstreamHandler.java b/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/router/IotEmqxDownstreamHandler.java index da500835d0..14995c4384 100644 --- a/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/router/IotEmqxDownstreamHandler.java +++ b/yudao-module-iot/yudao-module-iot-gateway/src/main/java/cn/iocoder/yudao/module/iot/gateway/protocol/emqx/router/IotEmqxDownstreamHandler.java @@ -79,6 +79,7 @@ public class IotEmqxDownstreamHandler { // 2. 根据消息方法和回复状态,构建 topic boolean isReply = IotDeviceMessageUtils.isReplyMessage(message); + // TODO @芋艿:看看基于 message 的 method 去反向推导; // 3. 根据消息方法类型构建对应的主题 switch (methodEnum) { case PROPERTY_POST: @@ -96,6 +97,7 @@ public class IotEmqxDownstreamHandler { break; case EVENT_POST: + // TODO @haohao:不用 eventIdentifier 拼接哈,直接 data 里面,有 identifier 字段 // 事件上报:只支持回复消息(下行) if (isReply) { String identifier = IotDeviceMessageUtils.getIdentifier(message); @@ -107,6 +109,7 @@ public class IotEmqxDownstreamHandler { case SERVICE_INVOKE: // 服务调用:支持请求和回复 + // TODO @haohao:不用 serviceIdentifier 拼接哈,直接 data 里面,有 identifier 字段 String serviceIdentifier = IotDeviceMessageUtils.getIdentifier(message); if (StrUtil.isNotBlank(serviceIdentifier)) { if (isReply) {