Browse Source

******************WX *********************
类型

zhangweixin 4 years ago
parent
commit
11bf59fd83

+ 16 - 12
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/EquipApi.kt

@@ -339,19 +339,23 @@ object EquipApi {
     }
 
     fun delRel(groupCode: String, projectId: String, jsonObject: JSONObject): Boolean {
-        /** 直接 http 请求还是通过注册中心 */
-        if (!Configure.customProperties.eurekaorhttp) {
-            val url = "${opts.data_rwd}/rwd/instance/relation/delete?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
-            val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, jsonObject)
-            if (postObject.result == "success") {
-                return true
-            }
-        } else {
-            val url = "http://${Configure.serviceNameConfig.DMPRWD}/rwd/instance/relation/delete?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
-            val postObject = Configure.restTemplate.postForObject(url, jsonObject, MiddleGroundDataRespose::class.java)
-            if (postObject.result == "success") {
-                return true
+        try {
+            /** 直接 http 请求还是通过注册中心 */
+            if (!Configure.customProperties.eurekaorhttp) {
+                val url = "${opts.data_rwd}/rwd/instance/relation/delete?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
+                val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, jsonObject)
+                if (postObject.result == "success") {
+                    return true
+                }
+            } else {
+                val url = "http://${Configure.serviceNameConfig.DMPRWD}/rwd/instance/relation/delete?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
+                val postObject = Configure.restTemplate.postForObject(url, jsonObject, MiddleGroundDataRespose::class.java)
+                if (postObject.result == "success") {
+                    return true
+                }
             }
+        } catch (e: Exception) {
+            e.printStackTrace()
         }
         return false
     }