Browse Source

生成代码,按文件名排序

lichunlei 3 months ago
parent
commit
20add7f175
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Controllers/Client/MakeCodeController.cs

+ 3 - 2
Controllers/Client/MakeCodeController.cs

@@ -11,6 +11,7 @@ using Custom;
 using Feign;
 using Common;
 using Util;
+using System.Linq;
 
 
 namespace Controllers.Client
@@ -51,7 +52,7 @@ namespace Controllers.Client
                 Function.WriteLog("databaseIds:" + databaseIds.Count.ToString(), "测试生成代码");
                 foreach(var databaseId in databaseIds)
                 {
-                    var tables = _DatabaseTableService.GetList(a => a.databaseId == databaseId);
+                    var tables = _DatabaseTableService.GetList(a => a.databaseId == databaseId).OrderBy(a => a.tableName).ToList();
                     Function.WriteLog("tables:" + tables.Count.ToString(), "测试生成代码");
                     foreach(var table in tables)
                     {
@@ -66,7 +67,7 @@ namespace Controllers.Client
                 Function.WriteLog("apiGroups:" + apiGroups.Count.ToString(), "测试生成代码");
                 foreach(var apiGroup in apiGroups)
                 {
-                    var apiInfos = _ApiInfoService.GetList(a => a.groupId == apiGroup.id);
+                    var apiInfos = _ApiInfoService.GetList(a => a.groupId == apiGroup.id).OrderBy(a => a.linkTableName).ToList();
                     Function.WriteLog("apiInfos:" + apiInfos.Count.ToString(), "测试生成代码");
                     foreach(var apiInfo in apiInfos)
                     {