优化代码生成
This commit is contained in:
26
ZR.Common/JnHelper.cs
Normal file
26
ZR.Common/JnHelper.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="CSRedisCore" Version="3.8.3" />
|
||||
<PackageReference Include="EPPlus" Version="6.0.5" />
|
||||
<PackageReference Include="JinianNet.JNTemplate" Version="2.3.0" />
|
||||
<PackageReference Include="MailKit" Version="3.3.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user