浏览代码

rabbitmq配置

lin 3 年之前
父节点
当前提交
5c5f7a7eb5

+ 6 - 6
zoniot-rmcp/zoniot-rmcp-dap/src/main/java/com/bz/rmcp/dap/controller/RabbitMqMsgController.java

@@ -77,8 +77,8 @@ public class RabbitMqMsgController {
 
     @PostMapping("sendDeviceLoraData")
     public void sendDeviceLoraData(
-            @ApiParam(value = "deviceNo", required = true) @RequestParam String deviceNo,
-            @ApiParam(value = "json", required = true,example = "{\"VOL\":3.56,\"ALARM\":\"0\",\"VOL_STATUS\":\"0\",\"VALVE\":\"01\",\"WSV\":90,\"FORCED\":\"0\",\"DISTURB\":\"0\",\"OVERDRAFT\":\"0\"}") @RequestParam String json
+            @ApiParam(value = "设备编号", required = true) @RequestParam String deviceNo,
+            @ApiParam(value = "json", required = true) @RequestParam(defaultValue = "{\"VOL\":3.56,\"ALARM\":\"0\",\"VOL_STATUS\":\"0\",\"VALVE\":\"01\",\"WSV\":90,\"FORCED\":\"0\",\"DISTURB\":\"0\",\"OVERDRAFT\":\"0\"}") String json
     ){
         Map<String,Object> param  = JSON.parseObject(json, HashMap.class);
         Map<Date,String> map = new HashMap<>();
@@ -87,7 +87,7 @@ public class RabbitMqMsgController {
         DeviceOrigDataDTO dto = new DeviceOrigDataDTO();
         dto.setId(1L);
         dto.setAgentIdentifier("");
-        dto.setDeviceNo("77777777");
+        dto.setDeviceNo(deviceNo);
         dto.setMode("");
         dto.setType("");
         dto.setManufacturer("");
@@ -102,8 +102,8 @@ public class RabbitMqMsgController {
 
     @PostMapping("sendDeviceNbData")
     public void sendDeviceNbData(
-            @ApiParam(value = "deviceNo", required = true) @RequestParam String deviceNo,
-            @ApiParam(value = "json", required = true,example = "{\"REMOVE_STATUS\":\"0\",\"VOL_STATUS\":\"0\",\"VALVE\":\"01\",\"WSV\":90,\"DISTURB\":\"0\"}") @RequestParam String json
+            @ApiParam(value = "设备编号", required = true) @RequestParam String deviceNo,
+            @ApiParam(value = "json", required = true) @RequestParam(defaultValue = "{\"REMOVE_STATUS\":\"0\",\"VOL_STATUS\":\"0\",\"VALVE\":\"01\",\"WSV\":90,\"DISTURB\":\"0\"}") String json
     ){
 
         Map<String,Object> param  = JSON.parseObject(json, HashMap.class);
@@ -113,7 +113,7 @@ public class RabbitMqMsgController {
         DeviceOrigDataDTO dto = new DeviceOrigDataDTO();
         dto.setId(1L);
         dto.setAgentIdentifier("");
-        dto.setDeviceNo("77777777");
+        dto.setDeviceNo(deviceNo);
         dto.setMode("");
         dto.setType("");
         dto.setManufacturer("");

+ 4 - 3
zoniot-rmcp/zoniot-rmcp-web/src/main/resources/application-sit.properties

@@ -88,9 +88,10 @@ spring.rabbitmq.template.mandatory=true
 spring.data.mongodb.uri=mongodb://10.0.0.63:27017/meter-reading-database
 logging.level.org.springframework.data.mongodb.core=DEBUG
 
-receive.exchange.name=messageExchangeTest
-dispath.routing.key=dipathKeyTest1
-dispath.queue=dispathTest1
+receive.exchange.name=messageExchange
+dispath.routing.key=dipathKey
+dispath.queue=dispath
+
 
 
 ribbon.OkToRetryOnAllOperations=false