feat():接受HTTP请求
parent
24b8fe4085
commit
f68c4ca325
|
@ -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<String> online(
|
||||
@Validated @RequestBody WebHookConnection webHookConnection){
|
||||
rabbitTemplate.convertAndSend("getaway","fluxmq",webHookConnection);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
Loading…
Reference in New Issue