feat: 完善搭建生成器
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
internal class FieldTemplateHandler : TemplateHandlerBase, ITemplateHandler
|
||||
{
|
||||
public string Invoker(string str)
|
||||
{
|
||||
//从数据库中获取到全部字段,然后根据字段生成字符串,进行替换
|
||||
return str.Replace("@field", "");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
public interface ITemplateHandler
|
||||
{
|
||||
string Invoker(string str);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EasyTool;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
internal class ModelTemplateHandler : TemplateHandlerBase, ITemplateHandler
|
||||
{
|
||||
public string Invoker(string str)
|
||||
{
|
||||
return str.Replace("@model", StrUtil.ToFirstLetterLowerCase(Table.Name)).Replace("@Model", StrUtil.ToFirstLetterUpperCase(Table.Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
internal class NameSpaceTemplateHandler : TemplateHandlerBase, ITemplateHandler
|
||||
{
|
||||
public string Invoker(string str)
|
||||
{
|
||||
return str.Replace("@Namespace", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Module.WebFirstManager.Entities;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
public class TemplateHandlerBase
|
||||
{
|
||||
protected TableEntity Table { get; set; }
|
||||
|
||||
protected List<FieldEntity> Fields { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user