Ver Fonte

更新!

TRX há 1 ano atrás
pai
commit
f909d107ec

+ 3 - 2
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/iot/IotFreshService.java

@@ -3,6 +3,7 @@ package com.zhongshu.iot.server.core.service.iot;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.github.microservice.dataConfig.IotTtlConfig;
+import com.github.microservice.deviceTopicConfig.IotTopIcConfig;
 import com.github.microservice.models.iotDeviceData.IotDeviceDataSimpleModel;
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.iot.server.core.dao.mqtt.DeviceInfoDao;
@@ -50,7 +51,7 @@ public class IotFreshService {
         String iotThingId = messageResult.getIotThingId();
         String deviceId = messageResult.getDeviceId();
         String messageId = messageResult.getMessageId();
-        String topicDevice = String.format("/page/fresh/message/%s", deviceId);
+        String topicDevice = String.format(IotTopIcConfig.mqttMessageUpdateTopIc, deviceId);
 
         JSONObject data = new JSONObject();
         data.set("iotThingId", iotThingId);
@@ -86,7 +87,7 @@ public class IotFreshService {
         IotMain iotMain = entity.getIotMain();
         String iotThingId = iotMain.getIotThingId();
         String messageId = entity.getId();
-        String topicDevice = String.format("/page/fresh/message/%s", iotThingId);
+        String topicDevice = String.format(IotTopIcConfig.iotPropertyUpdateTopIc, iotThingId);
 
         IotDeviceDataSimpleModel model = iotDeviceDataService.toSimpleModel(entity);
         JSONObject data = JSONUtil.parseObj(model);