Selaa lähdekoodia

调整生成代码接口

lichunlei 4 kuukautta sitten
vanhempi
commit
d409267252

+ 1 - 1
Controllers/Client/MakeCodeController.cs

@@ -47,7 +47,7 @@ namespace Controllers.Client
                 Function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(param), "测试生成代码");
                 ProjectService baseInfo = IProject.getProjectService(param.serviceId);
                 Function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(baseInfo), "测试生成代码");
-                List<int> databaseIds = Tools.SpitIntArrary(baseInfo.databaseList).ToList();
+                List<int> databaseIds = baseInfo.databaseList.ToList();
                 Function.WriteLog("databaseIds:" + databaseIds.Count.ToString(), "测试生成代码");
                 foreach(var databaseId in databaseIds)
                 {

+ 2 - 0
Feign/IProject.cs

@@ -16,7 +16,9 @@ namespace Feign
         public static ProjectService getProjectService(int id)
         {
             string url = Utils.FeignUrl["omega_project"] + "/v1/omega_project/ProjectService/getProjectServiceQuery?id=" + id;
+            Function.WriteLog(url, "获取项目信息");
             string content = Function.GetWebRequest(url);
+            Function.WriteLog(content, "获取项目信息");
             JsonData jsonObj = JsonMapper.ToObject(content);
             if(jsonObj["status"].ToString() == "1")
             {

+ 2 - 2
Model/Custom/ProjectService.cs

@@ -74,13 +74,13 @@ namespace Custom
         /// <summary>
         /// 服务器
         /// </summary>
-        public string? serverList { get; set; }
+        public int[] serverList { get; set; }
 
 
         /// <summary>
         /// 数据库
         /// </summary>
-        public string? databaseList { get; set; }
+        public int[] databaseList { get; set; }
 
 
         /// <summary>

+ 2 - 1
Services/DatabaseTableService.cs

@@ -341,7 +341,8 @@ namespace Services
         {
             var apiInfos = _ApiInfoService.GetList(m => m.serviceId == baseInfo.id && m.controllerFilePath == controllerPath);
 
-            var tables = GetList(m => apiInfos.Exists(n => n.linkTableId == m.id));
+            var tableIds = apiInfos.Where(m => m.linkTableId > 0).Select(m => m.linkTableId).Distinct().ToList();
+            var tables = GetList(m => tableIds.Contains(m.id));
             foreach(var apiInfo in apiInfos)
             {
                 var linkTable = tables.FirstOrDefault(m => m.id == apiInfo.linkTableId) ?? new DatabaseTable();