From 7748fdaa6e4fbf19f8ff4578bfa69139b4816499 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Tue, 28 May 2024 16:50:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E6=88=91?= =?UTF-8?q?=E4=B9=90=E9=85=8D=E9=80=81=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../olo/controller/OrderController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java index 224fd9b22..12bb4176c 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java @@ -9,7 +9,9 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.core.tool.api.R; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,6 +36,19 @@ import java.util.stream.Collectors; public class OrderController { private final DeliveryNoteService service; + private final RabbitTemplate rabbitTemplate; + + @ResponseBody + @PostMapping("sendMsg") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "推送节点数据", notes = "推送节点数据") + public R order(@RequestBody Map param) { + log.info("推送节点数据:{} ", JSONUtil.toJsonStr(param)); + String msg = JSONUtil.toJsonStr(param); + rabbitTemplate.convertAndSend(FactoryDataConstants.Mq.RoutingKeys.OLO_NODE_DATA_PUSH, + FactoryDataConstants.Mq.RoutingKeys.OLO_NODE_DATA_PUSH, msg); + return R.success("推送成功"); + } @ResponseBody @PostMapping