mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 23:13:40 +08:00
fix issue #I3IVVC
代码生成器调整为按新的结构生成代码
This commit is contained in:
parent
cf23d0025f
commit
b061f77495
@ -290,7 +290,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
domainContent = domainContent.Replace("{BaseAppName}", "BaseStringApp");
|
domainContent = domainContent.Replace("{BaseAppName}", "BaseStringApp");
|
||||||
}
|
}
|
||||||
FileHelper.WriteFile(appRootPath, sysTableInfo.ModuleCode + ".cs", domainContent);
|
FileHelper.WriteFile($"{appRootPath}\\{sysTableInfo.ModuleCode}", $"{sysTableInfo.ModuleCode}.cs", domainContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -313,7 +313,7 @@ namespace OpenAuth.App
|
|||||||
.Replace("{ModuleName}", sysTableInfo.ModuleName)
|
.Replace("{ModuleName}", sysTableInfo.ModuleName)
|
||||||
.Replace("{ClassName}", sysTableInfo.ClassName)
|
.Replace("{ClassName}", sysTableInfo.ClassName)
|
||||||
.Replace("{StartName}", StratName);
|
.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);
|
domainContent);
|
||||||
|
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ namespace OpenAuth.App
|
|||||||
tableAttr.Append("\r\n");
|
tableAttr.Append("\r\n");
|
||||||
domainContent = domainContent.Replace("{AttributeManager}", tableAttr.ToString());
|
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);
|
domainContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
if (type == "DateTime")
|
if (type == "DateTime")
|
||||||
{
|
{
|
||||||
return "DateTime.Now;";
|
return "DateTime.Now";
|
||||||
}
|
}
|
||||||
return Activator.CreateInstance(t).ToString();
|
return Activator.CreateInstance(t).ToString();
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ namespace OpenAuth.App.Test
|
|||||||
|
|
||||||
//模拟路径
|
//模拟路径
|
||||||
var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
|
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<IPathProvider>();
|
var mockPathProvider = new Mock<IPathProvider>();
|
||||||
mockPathProvider.Setup(x => x.MapPath("",false)).Returns(path);
|
mockPathProvider.Setup(x => x.MapPath("",false)).Returns(path);
|
||||||
services.AddScoped(x => mockHttpFac.Object);
|
services.AddScoped(x => mockHttpFac.Object);
|
||||||
@ -70,15 +70,6 @@ namespace OpenAuth.App.Test
|
|||||||
public void CreateEntity()
|
public void CreateEntity()
|
||||||
{
|
{
|
||||||
var app = _autofacServiceProvider.GetService<BuilderTableApp>();
|
var app = _autofacServiceProvider.GetService<BuilderTableApp>();
|
||||||
// var id = app.Add(new AddOrUpdateBuilderTableReq()
|
|
||||||
// {
|
|
||||||
// TableName = "application",
|
|
||||||
// Comment = "这是一个普通的应用管理生成模版",
|
|
||||||
// ClassName = "Application",
|
|
||||||
// Folder = "Application",
|
|
||||||
// ModuleCode = "Application",
|
|
||||||
// ModuleName = "模块管理"
|
|
||||||
// });
|
|
||||||
|
|
||||||
app.CreateEntity(new CreateEntityReq
|
app.CreateEntity(new CreateEntityReq
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user