feat:【IoT 物联网】更新设备消息处理逻辑,重构 MQTT 下行消息处理器,优化主题构建和消息发布流程

This commit is contained in:
haohao
2025-06-13 11:51:05 +08:00
parent b06556da2d
commit 569eef4a74
13 changed files with 344 additions and 749 deletions

View File

@@ -22,7 +22,7 @@ import java.time.LocalDateTime;
/**
* 针对 {@link IotDeviceMessage} 的业务处理器:调用 method 对应的逻辑。例如说:
* 1. {@link IotDeviceMessageMethodEnum#PROPERTY_REPORT} 属性上报时,记录设备属性
* 1. {@link IotDeviceMessageMethodEnum#PROPERTY_POST} 属性上报时,记录设备属性
*
* @author alwayssuper
*/

View File

@@ -126,7 +126,7 @@ public class IotDeviceMessageServiceImpl implements IotDeviceMessageService {
@Override
public void handleUpstreamDeviceMessage(IotDeviceMessage message, IotDeviceDO device) {
// 1. 理消息
// 1. 理消息
Object replyData = null;
ServiceException serviceException = null;
try {
@@ -175,8 +175,7 @@ public class IotDeviceMessageServiceImpl implements IotDeviceMessageService {
}
// 属性上报
if (Objects.equal(message.getMethod(), IotDeviceMessageMethodEnum.PROPERTY_REPORT.getMethod()) ||
Objects.equal(message.getMethod(), IotDeviceMessageMethodEnum.PROPERTY_POST.getMethod())) {
if (Objects.equal(message.getMethod(), IotDeviceMessageMethodEnum.PROPERTY_POST.getMethod())) {
devicePropertyService.saveDeviceProperty(device, message);
return null;
}