Commit 0d586e5a authored by 赵啸非's avatar 赵啸非

添加设备消息接收下发功能

parent 3be3b7d9
......@@ -213,7 +213,7 @@ public class DeviceApiController {
@PostMapping("callback")
@UnAuth
public String callback(@RequestBody List<DeviceMsgReq> list) {
log.debug("【设备数据消息接收】【请求体】--> " + JSONObject.toJSONString(list));
log.info("【设备数据消息接收】【请求体】--> " + JSONObject.toJSONString(list));
ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
......
......@@ -62,9 +62,9 @@ public class DownMsgTask implements Runnable {
return;
}
String exchangeName = platformEntity.getPlatformSn() + Constant.EXCHANGE_SPLIT + productEntity.getProductCode();
TopicPartitionInfo info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.UPLOAD_TOPIC + deviceEntity.getDeviceMac()).build();
TopicPartitionInfo info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + deviceEntity.getDeviceMac()).build();
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, Constant.MESSAGETYPE_HEARTBEAT);
header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString());
deviceService.sendDeviceMessage(deviceEntity, info, header, JSON.toJSONString(item.getData()), null);
}
......
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 to comment