Browse Source

feat(all): 增加我乐配送节点数据推送

dist.1.3.0
zhaoqiaobo 8 months ago
parent
commit
7748fdaa6e
  1. 15
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/controller/OrderController.java

15
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

Loading…
Cancel
Save