优化代码生成

This commit is contained in:
不做码农
2022-07-05 18:04:59 +08:00
parent 78aa48a975
commit e16997a204
6 changed files with 185 additions and 218 deletions

26
ZR.Common/JnHelper.cs Normal file
View File

@@ -0,0 +1,26 @@
using JinianNet.JNTemplate;
using System;
using System.IO;
namespace ZR.Common
{
public class JnHelper
{
/// <summary>
/// 读取Jn模板
/// </summary>
/// <param name="dirPath"></param>
/// <param name="tplName"></param>
/// <returns></returns>
public static ITemplate ReadTemplate(string dirPath, string tplName)
{
string path = Environment.CurrentDirectory;
string fullName = Path.Combine(path, "wwwroot", dirPath, tplName);
if (File.Exists(fullName))
{
return Engine.LoadTemplate(fullName);
}
return null;
}
}
}

View File

@@ -8,6 +8,7 @@
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
<PackageReference Include="CSRedisCore" Version="3.8.2" />
<PackageReference Include="EPPlus" Version="6.0.4" />
<PackageReference Include="JinianNet.JNTemplate" Version="2.3.0" />
<PackageReference Include="MailKit" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
</ItemGroup>