Browse Source

新增工具api 查询IBMmq目前队列深度

andy 1 year ago
parent
commit
e722ae3e73
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/main/java/com/scbfkj/uni/api/UtilApi.java

+ 8 - 2
src/main/java/com/scbfkj/uni/api/UtilApi.java

@@ -1,11 +1,15 @@
 package com.scbfkj.uni.api;
 
 import com.scbfkj.uni.library.IbmmqUtil;
+import com.scbfkj.uni.library.UniReturnUtil;
+import org.springframework.http.ResponseEntity;
 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;
 
+import java.util.Map;
+
 
 @RestController
 @RequestMapping("util")
@@ -87,7 +91,9 @@ public class UtilApi {
     }
 
     @PostMapping("ibmmq/depth")
-    public int ibmmqDepth(@RequestBody(required = true) IbmmqProp prop) {
-        return IbmmqUtil.getDepth(prop.getHost(), prop.getPort(), prop.getCCSID(), prop.getQueueManager(), prop.getChannel(), prop.getQueueName(), prop.getUserName(), prop.getPassword());
+    public ResponseEntity<Map<String,Object>> ibmmqDepth(@RequestBody(required = true) IbmmqProp prop) {
+        int depth = IbmmqUtil.getDepth(prop.getHost(), prop.getPort(), prop.getCCSID(), prop.getQueueManager(), prop.getChannel(), prop.getQueueName(), prop.getUserName(), prop.getPassword());
+
+        return ResponseEntity.ok(UniReturnUtil.success(depth));
     }
 }