Commit fc40e759 authored by 赵啸非's avatar 赵啸非

添加服务检测拉起脚本

parent f4c54c74
package com.mortals.xhx.busiz.web; package com.mortals.xhx.busiz.web;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.message.impl.MessageProducer; import com.mortals.xhx.base.system.message.impl.MessageProducer;
import com.mortals.xhx.busiz.req.UploadDeviceReq; import com.mortals.xhx.busiz.req.UploadDeviceReq;
...@@ -42,6 +42,7 @@ public class DeviceSendMsgController { ...@@ -42,6 +42,7 @@ public class DeviceSendMsgController {
@PostMapping("refreshMessage") @PostMapping("refreshMessage")
@UnAuth
public String refreshMessage(@RequestBody UploadDeviceReq req) { public String refreshMessage(@RequestBody UploadDeviceReq req) {
log.info("【设备通知刷新数据】【请求体】--> " + JSONObject.toJSONString(req)); log.info("【设备通知刷新数据】【请求体】--> " + JSONObject.toJSONString(req));
ApiResp<String> rsp = new ApiResp<>(); ApiResp<String> rsp = new ApiResp<>();
...@@ -56,7 +57,7 @@ public class DeviceSendMsgController { ...@@ -56,7 +57,7 @@ public class DeviceSendMsgController {
header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode()); header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime()); header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), Base64.encode(new JSONObject().toJSONString()), header); TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), "W10=", header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg)); messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg));
} }
} catch (Exception e) { } catch (Exception e) {
......
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