From f68c4ca3250e78b7ca38c8882ec28ec9dc1cc6a4 Mon Sep 17 00:00:00 2001 From: SuiXxx <1752599835@qq.com> Date: Fri, 11 Oct 2024 19:52:47 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E6=8E=A5=E5=8F=97HTTP=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FluxMqCallbackController.java | 27 +++++++++++++++++++ .../vehicle/domain/req/WebHookConnection.java | 25 +++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/controller/FluxMqCallbackController.java create mode 100644 cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/domain/req/WebHookConnection.java diff --git a/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/controller/FluxMqCallbackController.java b/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/controller/FluxMqCallbackController.java new file mode 100644 index 0000000..7c6a172 --- /dev/null +++ b/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/controller/FluxMqCallbackController.java @@ -0,0 +1,27 @@ +package com.muyu.vehicle.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.vehicle.domain.req.WebHookConnection; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@RequestMapping("/fluxmq") +public class FluxMqCallbackController { + + @Autowired private RabbitTemplate rabbitTemplate; + + @PostMapping("/send") + public Result online( + @Validated @RequestBody WebHookConnection webHookConnection){ + rabbitTemplate.convertAndSend("getaway","fluxmq",webHookConnection); + return Result.success(); + } + +} diff --git a/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/domain/req/WebHookConnection.java b/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/domain/req/WebHookConnection.java new file mode 100644 index 0000000..00ff8c1 --- /dev/null +++ b/cloud-modules/cloud-modules-vehiclegateway/src/main/java/com/muyu/vehicle/domain/req/WebHookConnection.java @@ -0,0 +1,25 @@ +package com.muyu.vehicle.domain.req; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class WebHookConnection { + + private String protocol; + private String timestamp; + private String version; + private String keepalive; + private String cleanSession; + private String nodeIp; + private String clientId; + private String clientIp; + private String clientPort; + private String MessageId; + +}