2023-09-21 00:04:55 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using EasyTool;
|
2023-09-21 19:55:55 +08:00
|
|
|
|
using Furion.DependencyInjection;
|
2023-09-21 00:04:55 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.Module.WebFirstManager.Handler
|
|
|
|
|
|
{
|
2023-09-22 10:25:05 +08:00
|
|
|
|
public class ModelTemplateHandler : TemplateHandlerBase, ITemplateHandler, ISingleton
|
2023-09-21 00:04:55 +08:00
|
|
|
|
{
|
2023-09-27 18:01:10 +08:00
|
|
|
|
public HandledTemplate Invoker(string str, string path)
|
2023-09-21 00:04:55 +08:00
|
|
|
|
{
|
2023-09-27 18:01:10 +08:00
|
|
|
|
var output = new HandledTemplate();
|
|
|
|
|
|
output.TemplateStr= str.Replace("@model", StrUtil.ToFirstLetterLowerCase(Table.Name)).Replace("@Model", StrUtil.ToFirstLetterUpperCase(Table.Name));
|
|
|
|
|
|
output.BuildPath = path.Replace("@model", StrUtil.ToFirstLetterLowerCase(Table.Name)).Replace("@Model", StrUtil.ToFirstLetterUpperCase(Table.Name));
|
|
|
|
|
|
return output;
|
2023-09-21 00:04:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|