mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
测试RabbitMQ
This commit is contained in:
@@ -25,6 +25,7 @@ import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.service.OrderService;
|
||||
import com.jsowell.service.TempService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -65,6 +66,9 @@ public class TempController extends BaseController {
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
private SettleOrderReportService settleOrderReportService;
|
||||
|
||||
@@ -583,4 +587,13 @@ public class TempController extends BaseController {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试RabbitMQ
|
||||
*/
|
||||
@PostMapping("/testRabbitMQ")
|
||||
public RestApiResponse<?> testRabbitMQ(@RequestBody TestRabbitMQDTO dto) {
|
||||
rabbitTemplate.convertAndSend(dto.getExchange(), dto.getRoutingKey(), dto.getData());
|
||||
return new RestApiResponse<>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user