From b061f77495b4c266b7e4116315c5458cdaf43729 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Thu, 15 Apr 2021 15:44:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=20issue=20#I3IVVC=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=99=A8=E8=B0=83=E6=95=B4=E4=B8=BA=E6=8C=89?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E7=BB=93=E6=9E=84=E7=94=9F=E6=88=90=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/BuilderTable/BuilderTableApp.cs | 8 ++++---- OpenAuth.App/Test/TestBuilder.cs | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/OpenAuth.App/BuilderTable/BuilderTableApp.cs b/OpenAuth.App/BuilderTable/BuilderTableApp.cs index 37984c0a..9fde3eb7 100644 --- a/OpenAuth.App/BuilderTable/BuilderTableApp.cs +++ b/OpenAuth.App/BuilderTable/BuilderTableApp.cs @@ -290,7 +290,7 @@ namespace OpenAuth.App { domainContent = domainContent.Replace("{BaseAppName}", "BaseStringApp"); } - FileHelper.WriteFile(appRootPath, sysTableInfo.ModuleCode + ".cs", domainContent); + FileHelper.WriteFile($"{appRootPath}\\{sysTableInfo.ModuleCode}", $"{sysTableInfo.ModuleCode}.cs", domainContent); } /// @@ -313,7 +313,7 @@ namespace OpenAuth.App .Replace("{ModuleName}", sysTableInfo.ModuleName) .Replace("{ClassName}", sysTableInfo.ClassName) .Replace("{StartName}", StratName); - FileHelper.WriteFile(Path.Combine(appRootPath, "Request"), $"Query{sysTableInfo.ClassName}ListReq.cs", + FileHelper.WriteFile(Path.Combine(appRootPath, $"{sysTableInfo.ModuleCode}\\Request"), $"Query{sysTableInfo.ClassName}ListReq.cs", domainContent); @@ -352,7 +352,7 @@ namespace OpenAuth.App tableAttr.Append("\r\n"); domainContent = domainContent.Replace("{AttributeManager}", tableAttr.ToString()); - FileHelper.WriteFile(Path.Combine(appRootPath, "Request"), $"AddOrUpdate{sysTableInfo.ClassName}Req.cs", + FileHelper.WriteFile(Path.Combine(appRootPath, $"{sysTableInfo.ModuleCode}\\Request"), $"AddOrUpdate{sysTableInfo.ClassName}Req.cs", domainContent); } @@ -528,7 +528,7 @@ namespace OpenAuth.App { if (type == "DateTime") { - return "DateTime.Now;"; + return "DateTime.Now"; } return Activator.CreateInstance(t).ToString(); } diff --git a/OpenAuth.App/Test/TestBuilder.cs b/OpenAuth.App/Test/TestBuilder.cs index 998a73bf..7fcf251f 100644 --- a/OpenAuth.App/Test/TestBuilder.cs +++ b/OpenAuth.App/Test/TestBuilder.cs @@ -39,7 +39,7 @@ namespace OpenAuth.App.Test //模拟路径 var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) - .Replace("\\OpenAuth.App\\bin\\Debug\\net5.0",""); + .Replace("\\OpenAuth.App\\bin\\Debug\\netcoreapp3.1",""); var mockPathProvider = new Mock(); mockPathProvider.Setup(x => x.MapPath("",false)).Returns(path); services.AddScoped(x => mockHttpFac.Object); @@ -70,15 +70,6 @@ namespace OpenAuth.App.Test public void CreateEntity() { var app = _autofacServiceProvider.GetService(); - // var id = app.Add(new AddOrUpdateBuilderTableReq() - // { - // TableName = "application", - // Comment = "这是一个普通的应用管理生成模版", - // ClassName = "Application", - // Folder = "Application", - // ModuleCode = "Application", - // ModuleName = "模块管理" - // }); app.CreateEntity(new CreateEntityReq {