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; + +}