lcl 8 ماه پیش
والد
کامیت
678f65aac5

+ 24 - 5
Controllers/PageUpdateInfoController.cs

@@ -22,16 +22,16 @@ namespace Controllers
     // [ApiExplorerSettings(GroupName = "PageUpdateInfo")]
     public class PageUpdateInfoController : BaseController
     {
-        /// <summary>
-        /// api分组接口
-        /// </summary>
         private readonly IPageUpdateInfoService _PageUpdateInfoService;
+        private readonly IAppBottomNavsService _AppBottomNavsService;
+        private readonly IFileUpdateInfoService _FileUpdateInfoService;
 
 
-        public PageUpdateInfoController(IPageUpdateInfoService PageUpdateInfoService)
+        public PageUpdateInfoController(IPageUpdateInfoService PageUpdateInfoService, IAppBottomNavsService AppBottomNavsService, IFileUpdateInfoService FileUpdateInfoService)
         {
             _PageUpdateInfoService = PageUpdateInfoService;
-
+            _AppBottomNavsService = AppBottomNavsService;
+            _FileUpdateInfoService = FileUpdateInfoService;
         }
 
         /// <summary>
@@ -153,6 +153,25 @@ namespace Controllers
 
 
 
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        [HttpPut]
+        [Route("/Api/SystemSet/makeAppInitData")]
+        public string makeAppInitData([FromBody] MakeAppInitDataDto parm)
+        {
+            string AppInfoList = _AppBottomNavsService.makeAppInitData(parm.Kind);
+            string FileInfoList = _FileUpdateInfoService.makeAppInitData(parm.Kind);
+            string PageInfoList = _PageUpdateInfoService.makeAppInitData(parm.Kind);
+            return AppInfoList + "#cut#" + FileInfoList + "#cut#" + PageInfoList;
+        }
+
+
+
+
+
 
     }
 }

+ 13 - 0
Model/Dto/PageUpdateInfoListDto.cs

@@ -16,5 +16,18 @@ namespace Dto
 
 
 
+    }
+
+
+
+    public class MakeAppInitDataDto
+    {
+        /// <summary>
+        /// 分类
+        /// </summary>
+        public string? Kind { get; set; }
+
+
+
     }
 }

+ 12 - 1
Services/AppBottomNavsService.cs

@@ -7,6 +7,7 @@ using Model.Base;
 using Repository;
 using Service;
 using Microsoft.AspNetCore.Mvc;
+using Common;
 
 namespace Services
 {
@@ -37,7 +38,17 @@ namespace Services
 
 
 
-
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData([FromQuery] PageUpdateInfoListDto parm)
+        {
+            var obj = GetList(m => m.kind == parm.kind);
+            string str = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
+            return Dbconn.Encrypt3DES(str, "*ga34|^7");
+        }
 
 
 

+ 12 - 1
Services/FileUpdateInfoService.cs

@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Mvc;
 using Aliyun.OSS;
 using Infrastructure.Model;
 using Base;
+using Common;
 
 namespace Services
 {
@@ -91,7 +92,17 @@ namespace Services
 
 
 
-
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData(string kind)
+        {
+            var obj = GetList(m => m.kind == kind);
+            string str = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
+            return Dbconn.Encrypt3DES(str, "*ga34|^7");
+        }
 
 
     }

+ 6 - 1
Services/IService/IAppBottomNavsService.cs

@@ -19,7 +19,12 @@ namespace Services
 
 
 
-
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData(string kind);
 
 
 

+ 6 - 1
Services/IService/IFileUpdateInfoService.cs

@@ -29,6 +29,11 @@ namespace Services
 
 
 
-
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData(string kind);
     }
 }

+ 6 - 0
Services/IService/IPageUpdateInfoService.cs

@@ -28,6 +28,12 @@ namespace Services
 
 
 
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData(string kind);
 
 
     }

+ 32 - 0
Services/PageUpdateInfoService.cs

@@ -112,5 +112,37 @@ namespace Services
                 SystemFiles.Add(summary.Key);
             }
         }
+
+
+        /// <summary>
+        /// 生成APP配置文件
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>生成APP配置文件</returns>
+        public string makeAppInitData(string kind)
+        {
+            OssConfigs ossConfigs = new();
+            AppSettings.Bind("OssConfigs", ossConfigs);
+            string GotoPages = "{";
+            string PageInfoList = "{";
+            string LibFile = "{";
+            List<PageUpdateInfo> newpages = GetList(m => m.kind == kind).OrderBy(m => m.id).ToList();
+            foreach (PageUpdateInfo page in newpages)
+            {
+                string FileName = page.modulePath.Split('.')[0];
+                PageInfoList += "\"page" + FileName + "\":" + Newtonsoft.Json.JsonConvert.SerializeObject(page) + ",";
+                string PagePath = "template/app/" + kind + "/" + page.modulePath;
+                string pageContent = Function.GetNetFileContent(ossConfigs.Host + PagePath);
+                pageContent = Dbconn.Encrypt3DES(pageContent, "*ga34|^7");
+                LibFile += "\"page" + FileName + "\":\"" + pageContent + "\",";
+            }
+            PageInfoList = PageInfoList.TrimEnd(',');
+            PageInfoList += "}";
+            GotoPages = GotoPages.TrimEnd(',');
+            GotoPages += "}";
+            LibFile = LibFile.TrimEnd(',');
+            LibFile += "}";
+            return Dbconn.Encrypt3DES(PageInfoList, "*ga34|^7") + "#cut#" + GotoPages + "#cut#" + Dbconn.Encrypt3DES(LibFile, "*ga34|^7");
+        }
     }
 }