From 7adc1e5089f8d9bca903a345a2eaad2afbd52589 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 17 四月 2026 21:02:39 +0800
Subject: [PATCH] 合并代码
---
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java | 128 +++++++++++++++++++++---------------------
1 files changed, 64 insertions(+), 64 deletions(-)
diff --git a/xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java b/xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java
index 88a2f71..444fe66 100644
--- a/xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java
+++ b/xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java
@@ -1,64 +1,64 @@
-//package com.xiaopeng.automaticPilot.controller;
-//
-//import com.alibaba.fastjson2.JSONObject;
-//import com.xiaopeng.api.vo.automaticPilot.MqttPublishVo;
-//import com.xiaopeng.automaticPilot.service.KafkaConsumerService;
-//import com.xiaopeng.common.core.domain.R;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.kafka.annotation.KafkaListener;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//@Slf4j
-//@RestController
-//public class KafkaTestController {
-//
-// @Autowired
-// private KafkaConsumerService kafkaConsumerService;
-//
-// //TODO 少了factory属性声明
-//
-// /**
-// * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级)
-// *
-// * @param message 消息内容
-// */
-// @PostMapping("/test/kafka/xpu-high")
-// @KafkaListener(topics = "topic-prod-robotaxi-xpu-high", groupId = "group-robotaxi-xpu")
-// public void topicProdRobotaxiXpuHigh(@RequestBody String message) {
-// log.info("收到XPU上报高优先级主题消息: {}", message);
-// kafkaConsumerService.topicProdRobotaxiXpuHigh(message);
-// }
-//
-// //TODO 少了factory属性声明
-//
-// /**
-// * 消费消息 - XPU上报Robotaxi云端的消息topic(低优先级)
-// *
-// * @param message 消息内容
-// */
-// @PostMapping("/test/kafka/xpu-normal")
-// @KafkaListener(topics = "topic-prod-robotaxi-xpu-normal", groupId = "group-robotaxi-xpu")
-// public void topicProdRobotaxiXpuNormal(String message) {
-// log.info("收到XPU上报低优先级主题消息: {}", message);
-// kafkaConsumerService.topicProdRobotaxiXpuNormal(message);
-// }
-//
-// /**
-// * 模拟推送XPU消息
-// * @param message
-// * @return
-// */
-// @PostMapping("/base/v1/pushXPUMessage")
-// public R pushXPUMessage(@RequestBody String message) {
-// log.info("收到XPU推送消息: {}", message);
-// JSONObject json = new JSONObject();
-// json.put("ts", System.currentTimeMillis());
-// json.put("payload", message);
-// kafkaConsumerService.topicProdRobotaxiXpuHigh(json.toJSONString());
-// return R.ok();
-// }
-//}
+package com.xiaopeng.automaticPilot.controller;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.xiaopeng.api.vo.automaticPilot.MqttPublishVo;
+import com.xiaopeng.automaticPilot.service.KafkaConsumerService;
+import com.xiaopeng.common.core.domain.R;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.kafka.annotation.KafkaListener;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+public class KafkaTestController {
+
+ @Autowired
+ private KafkaConsumerService kafkaConsumerService;
+
+ //TODO 少了factory属性声明
+
+ /**
+ * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级)
+ *
+ * @param message 消息内容
+ */
+ @PostMapping("/test/kafka/xpu-high")
+ @KafkaListener(topics = "topic-prod-robotaxi-xpu-high", groupId = "group-robotaxi-xpu")
+ public void topicProdRobotaxiXpuHigh(@RequestBody String message) {
+ log.info("收到XPU上报高优先级主题消息: {}", message);
+ kafkaConsumerService.topicProdRobotaxiXpuHigh(message);
+ }
+
+ //TODO 少了factory属性声明
+
+ /**
+ * 消费消息 - XPU上报Robotaxi云端的消息topic(低优先级)
+ *
+ * @param message 消息内容
+ */
+ @PostMapping("/test/kafka/xpu-normal")
+ @KafkaListener(topics = "topic-prod-robotaxi-xpu-normal", groupId = "group-robotaxi-xpu")
+ public void topicProdRobotaxiXpuNormal(String message) {
+ log.info("收到XPU上报低优先级主题消息: {}", message);
+ kafkaConsumerService.topicProdRobotaxiXpuNormal(message);
+ }
+
+ /**
+ * 模拟推送XPU消息
+ * @param message
+ * @return
+ */
+ @PostMapping("/base/v1/pushXPUMessage")
+ public R pushXPUMessage(@RequestBody String message) {
+ log.info("收到XPU推送消息: {}", message);
+ JSONObject json = new JSONObject();
+ json.put("ts", System.currentTimeMillis());
+ json.put("payload", message);
+ kafkaConsumerService.topicProdRobotaxiXpuHigh(json.toJSONString());
+ return R.ok();
+ }
+}
--
Gitblit v1.7.1