:recycle:代码重构

This commit is contained in:
不做码农
2023-09-02 17:55:34 +08:00
parent c65952202a
commit be515339fe
176 changed files with 372 additions and 245 deletions
+28
View File
@@ -0,0 +1,28 @@
using JinianNet.JNTemplate;
using System;
using System.IO;
namespace Infrastructure.Helper
{
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);
}
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"未找到路径{fullName}");
return null;
}
}
}