feat:【IoT 物联网】更新设备消息处理逻辑,重构 MQTT 下行消息处理器,优化主题构建和消息发布流程
This commit is contained in:
@@ -22,7 +22,7 @@ import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 针对 {@link IotDeviceMessage} 的业务处理器:调用 method 对应的逻辑。例如说:
|
||||
* 1. {@link IotDeviceMessageMethodEnum#PROPERTY_REPORT} 属性上报时,记录设备属性
|
||||
* 1. {@link IotDeviceMessageMethodEnum#PROPERTY_POST} 属性上报时,记录设备属性
|
||||
*
|
||||
* @author alwayssuper
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user