Commit 13f928ae by huangjy

mqtt协议包,json参数改用object

parent 9898ffc0
...@@ -128,24 +128,7 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec { ...@@ -128,24 +128,7 @@ public class JetLinksMqttDeviceMessageCodec implements DeviceMessageCodec {
payLoad.setDeviceId(deviceMessage.getDeviceId()); payLoad.setDeviceId(deviceMessage.getDeviceId());
Map<String, Object> properties = ((WritePropertyMessage) deviceMessage).getProperties(); Map<String, Object> properties = ((WritePropertyMessage) deviceMessage).getProperties();
if (properties.get("usrServerInfo") != null) {
Map<String, Object> res = Maps.newConcurrentMap();
UserServerInfo userServerInfo = JSON.parseObject(properties.get("usrServerInfo").toString(), UserServerInfo.class);
res.put("usrServerInfo", userServerInfo);
payLoad.setProperties(res);
} else if (properties.get("radarAiParam") != null) {
Map<String, Object> res = Maps.newConcurrentMap();
RadarAiParam radarAiParam = JSON.parseObject(properties.get("radarAiParam") .toString(), RadarAiParam.class);
res.put("radarAiParam", radarAiParam);
payLoad.setProperties(res);
} else if (properties.get("radarAiExtent") != null) {
Map<String, Object> res = Maps.newConcurrentMap();
RadarAiExtent radarAiExtent = JSON.parseObject(properties.get("radarAiExtent").toString(), RadarAiExtent.class);
res.put("radarAiExtent", radarAiExtent);
payLoad.setProperties(res);
} else {
payLoad.setProperties(properties); payLoad.setProperties(properties);
}
customSendMessage.setPayload(payLoad); customSendMessage.setPayload(payLoad);
customSendMessage.setTimestamp(deviceMessage.getTimestamp()); customSendMessage.setTimestamp(deviceMessage.getTimestamp());
......
...@@ -12,5 +12,6 @@ public class RadarAiExtent { ...@@ -12,5 +12,6 @@ public class RadarAiExtent {
private Integer BorderLeftX; private Integer BorderLeftX;
private Integer BorderLeftY; private Integer BorderLeftY;
private Integer overallRightY; private Integer overallRightY;
private Integer overallRightX;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment