Browse Source

dto和vo生成,加上数组数据

lichunlei 4 months ago
parent
commit
c6d5149aac
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Services/DatabaseTableService.cs

+ 9 - 1
Services/DatabaseTableService.cs

@@ -23,13 +23,15 @@ namespace Services
         private readonly IDatabaseFieldService _DatabaseFieldService;
         private readonly IDatabaseFieldTabsService _DatabaseFieldTabsService;
         private readonly IApiInfoService _ApiInfoService;
+        private readonly IApiGroupService _ApiGroupService;
         
 
-        public DatabaseTableService(IDatabaseFieldService DatabaseFieldService, IDatabaseFieldTabsService DatabaseFieldTabsService, IApiInfoService ApiInfoService)
+        public DatabaseTableService(IDatabaseFieldService DatabaseFieldService, IDatabaseFieldTabsService DatabaseFieldTabsService, IApiInfoService ApiInfoService, IApiGroupService ApiGroupService)
         {
             _DatabaseFieldService = DatabaseFieldService;
             _DatabaseFieldTabsService = DatabaseFieldTabsService;
             _ApiInfoService = ApiInfoService;
+            _ApiGroupService = ApiGroupService;
         }
 
         /// <summary>
@@ -277,11 +279,14 @@ namespace Services
         /// <returns>生成java代码-dto</returns>
         public void makeJavaDto(ProjectService baseInfo, ApiInfo apiInfo, TokenModel loginUser)
         {
+            var apiGroup = _ApiGroupService.GetFirst(m => m.id == apiInfo.groupId) ?? new ApiGroup();
+
             Dictionary<string, object> pushData = new Dictionary<string, object>();
             pushData.Add("since", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             pushData.Add("author", loginUser.username);
             pushData.Add("projectService", baseInfo);
             pushData.Add("apiInfo", apiInfo);
+            pushData.Add("apiGroup", apiGroup);
             pushData.Add("databaseFields", apiInfo.apiParam);
             MakeHelper.Push(pushData, "dto", "javaDto", loginUser.username);
         }
@@ -293,11 +298,14 @@ namespace Services
         /// <returns>生成java代码-vo</returns>
         public void makeJavaVo(ProjectService baseInfo, ApiInfo apiInfo, TokenModel loginUser)
         {
+            var apiGroup = _ApiGroupService.GetFirst(m => m.id == apiInfo.groupId) ?? new ApiGroup();
+
             Dictionary<string, object> pushData = new Dictionary<string, object>();
             pushData.Add("since", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             pushData.Add("author", loginUser.username);
             pushData.Add("projectService", baseInfo);
             pushData.Add("apiInfo", apiInfo);
+            pushData.Add("apiGroup", apiGroup);
             pushData.Add("databaseFields", apiInfo.apiParam);
             MakeHelper.Push(pushData, "vo", "javaVo", loginUser.username);
         }