Przeglądaj źródła

修复获取服务信息接口

lichunlei 5 miesięcy temu
rodzic
commit
9c893c1e5b
2 zmienionych plików z 11 dodań i 4 usunięć
  1. 10 3
      Feign/IProject.cs
  2. 1 1
      Services/ApiGroupService.cs

+ 10 - 3
Feign/IProject.cs

@@ -1,4 +1,5 @@
 using Common;
+using LitJson;
 using Vo.Feign;
 
 namespace Feign
@@ -12,10 +13,16 @@ namespace Feign
         //     return Newtonsoft.Json.JsonConvert.DeserializeObject<List<PageForMiniProgramVo>>(content);
         // }
 
-        public static GetProjectServiceQueryVo getProject(int id)
+        public static GetProjectServiceQueryVo getProjectService(int id)
         {
-            string content = Function.GetWebRequest(Utils.FeignUrl["omega_project"] + "/v1/omega_project/ProjectService/getProjectServiceQuery?id=" + id);
-            return Newtonsoft.Json.JsonConvert.DeserializeObject<GetProjectServiceQueryVo>(content);
+            string url = Utils.FeignUrl["omega_project"] + "/v1/omega_project/ProjectService/getProjectServiceQuery?id=" + id;
+            string content = Function.GetWebRequest(url);
+            JsonData jsonObj = JsonMapper.ToObject(content);
+            if(jsonObj["status"].ToString() == "1")
+            {
+                return Newtonsoft.Json.JsonConvert.DeserializeObject<GetProjectServiceQueryVo>(jsonObj["data"].ToJson());
+            }
+            return new GetProjectServiceQueryVo();
         }
     }
 }

+ 1 - 1
Services/ApiGroupService.cs

@@ -52,7 +52,7 @@ namespace Services
         /// <param name="serviceId">服务id</param>
         public void makeApiDoc(int serviceId, TokenModel loginUser)
         {
-            var service = Feign.IProject.getProject(serviceId);
+            var service = Feign.IProject.getProjectService(serviceId);
             var apiGroups = GetList(m => m.serviceId == serviceId);
             var apiInfos = _ApiInfoService.GetList(m => m.serviceId == serviceId);
             foreach(var apiInfo in apiInfos)