|
@@ -3,11 +3,13 @@ package com.usky.dxtop.controller.web;
|
|
|
|
|
|
import com.usky.dxtop.service.config.rabbitmq.ChargeTransConfig;
|
|
|
import com.usky.dxtop.service.config.rabbitmq.DishTransConfig;
|
|
|
+import com.usky.dxtop.service.config.rabbitmq.charge.ChargeProduceConfig;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.Date;
|
|
@@ -30,6 +32,11 @@ public class TestController {
|
|
|
private RabbitTemplate dishTransRabbitTemplate;
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ @Qualifier(ChargeProduceConfig.TEMPLATE)
|
|
|
+ private RabbitTemplate cart;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@GetMapping("/chargeTest")
|
|
|
public String sendDirectMessageCharge() {
|
|
@@ -81,4 +88,14 @@ public class TestController {
|
|
|
return "ok";
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/cartPay")
|
|
|
+ public void cartPay(@RequestParam("id") Long id){
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("seq",id);
|
|
|
+ map.put("seq_charge",1111);
|
|
|
+ map.put("code",1);
|
|
|
+ map.put("msd","成功");
|
|
|
+ dishTransRabbitTemplate.convertAndSend(DishTransConfig.NAME, DishTransConfig.NAME, map);
|
|
|
+ }
|
|
|
+
|
|
|
}
|