222
schangxiang@126.com
2025-05-07 cac74f86a004d8b31869ad4b3931284343e56991
222
已修改1个文件
22 ■■■■ 文件已修改
Weben_CMS专用代码生成器/Code/MainForm.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.cs
@@ -81,6 +81,7 @@
        //一键生成所有文件
        private void btn_CreateFile_Click(object sender, EventArgs e)
        {
            var genCodeRootPath = "";
            try
            {
                projectNamePrefix = this.tb_ProjectNamePrefix.Text;
@@ -269,9 +270,10 @@
                //生成Model
                //CreateModelFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo);
                //CreateModelParamFile(columnList, tableName, filePrefixName, wcf_NameSpacePath, createPerson, chinaComment, entityName, modulelogo);
                 genCodeRootPath = tbPath.Text + @"\" + tb_WCF_NameSpacePath.Text.Trim();
                var webFolerPath = tb_WCF_NameSpacePath.Text.Trim() + "_Web";
                #region å®žä½“ç±»
                var entityFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim();
                var entityFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Dtos\" + tb_EntityName.Text.Trim();
                //1、生成 åˆ†é¡µæŸ¥è¯¢å®žä½“ æ–‡ä»¶
                str_generate = InputQueryModel_Generate.CreateQueryModelLText(param);
                tf = TextHelper.Export2File_V2(entityFilePath, $"Get{param.EntityName}Input.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -305,12 +307,12 @@
                #region AppSerivice
                //8、生成 IAppService æ–‡ä»¶
                var appServiceFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Services";
                var appServiceFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application.Contracts\Services";
                str_generate = IAppService_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(appServiceFilePath, $"I{param.EntityName}AppService.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
                //9、生成 AppService æ–‡ä»¶
                appServiceFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\Implements";
                appServiceFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\Implements";
                str_generate = AppService_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(appServiceFilePath, $"{param.EntityName}AppService.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -320,7 +322,7 @@
                #region Contorller
                //10、生成 Contorller æ–‡ä»¶
                var continerlllePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @"\Controller";
                var continerlllePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @"\Controller";
                str_generate = Controller_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(continerlllePath, $"{param.EntityName}Controller.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -330,7 +332,7 @@
                #region Domain
                //11、生成 IRepository æ–‡ä»¶
                var iRepositoryPath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Domain\" + tb_EntityName.Text.Trim(); ;
                var iRepositoryPath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Domain\" + tb_EntityName.Text.Trim(); ;
                str_generate = IRepository_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(iRepositoryPath, $"I{param.EntityName}Repository.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -340,7 +342,7 @@
                #region EntityFrameworkCore
                //12、生成 EfCoreRepository æ–‡ä»¶
                var efCoreRepositoryPath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".EntityFrameworkCore\Repositories";
                var efCoreRepositoryPath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".EntityFrameworkCore\Repositories";
                str_generate = EfCoreRepository_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(efCoreRepositoryPath, $"EfCore{param.EntityName}Repository.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -348,7 +350,7 @@
                #endregion
                #region Web
                var webRootPath = tbPath.Text + @"\web\src\widgets\" + tb_EntityName.Text.Trim();
                var webRootPath = genCodeRootPath + @"\" + webFolerPath + @"\src\widgets\" + tb_EntityName.Text.Trim();
                //13、生成 Index æ–‡ä»¶
                str_generate = Index_Generate.CreateText(param);
@@ -455,7 +457,7 @@
                //36、生成 AutoMapperProfile æ–‡ä»¶
                var autoMapFilePath = tbPath.Text + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles";
                var autoMapFilePath = genCodeRootPath + @"\server\src\CMS.Plugin." + tb_WCF_NameSpacePath.Text.Trim() + @".Application\MapperProfiles";
                str_generate = AutoMapperProfile_Generate.CreateText(param);
                tf = TextHelper.Export2File_V2(autoMapFilePath, param.EntityName + $"AutoMapperProfile.cs", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo);
@@ -524,7 +526,7 @@
            }
            //MessageBox.Show("生成文件成功!");
            //成功之后打开文件夹
            using (System.Diagnostics.Process.Start(this.tbPath.Text))
            using (System.Diagnostics.Process.Start(genCodeRootPath))
            {
            }