|
@@ -0,0 +1,26 @@
|
|
|
+package cn.gygxzc.envir.api.rabbitmq.controller
|
|
|
+
|
|
|
+import cn.gygxzc.tina.cloud.bus.messager.bean.MessageBean
|
|
|
+import cn.gygxzc.tina.cloud.bus.messager.sender.IMessagerSender
|
|
|
+import org.springframework.beans.factory.annotation.Autowired
|
|
|
+import org.springframework.web.bind.annotation.PostMapping
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping
|
|
|
+import org.springframework.web.bind.annotation.RestController
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by niantuo on 2018/9/29.
|
|
|
+ * 这个是一个消息总线的测试controller
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/v1/rabbit/send")
|
|
|
+class RabbitMQController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private lateinit var messageSender: IMessagerSender
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ fun send(message: MessageBean) {
|
|
|
+ messageSender.send(message)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|