feat: webfrist基本流程已完成
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
using System.Text;
|
||||
using EasyTool;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Furion.DependencyInjection;
|
||||
using Yi.Framework.Module.WebFirstManager.Enums;
|
||||
|
||||
namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
{
|
||||
public class FieldTemplateHandler : TemplateHandlerBase, ITemplateHandler, ISingleton
|
||||
{
|
||||
public string Invoker(string str)
|
||||
public HandledTemplate Invoker(string str,string path)
|
||||
{
|
||||
return str.Replace("@field", BuildFields());
|
||||
var output= new HandledTemplate();
|
||||
output.TemplateStr = str.Replace("@field", BuildFields());
|
||||
output.BuildPath = path;
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,15 +29,20 @@ namespace Yi.Framework.Module.WebFirstManager.Handler
|
||||
|
||||
foreach (var field in Table.Fields)
|
||||
{
|
||||
var typeStr = EnumUtil.GetDescriptionByValue(field.FieldType);
|
||||
var typeStr = typeof(FieldTypeEnum).GetFields().Where(x=> x.Name== field.FieldType.ToString())?.FirstOrDefault().GetCustomAttribute<DisplayAttribute>().Name;
|
||||
|
||||
if (typeStr is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var nameStr = field.Name;
|
||||
|
||||
//添加备注
|
||||
if (string.IsNullOrEmpty(field.Description))
|
||||
if (!string.IsNullOrEmpty(field.Description))
|
||||
{
|
||||
var desStr = "/// <summary>" +
|
||||
@$"///{field.Description}" +
|
||||
"/// </summary>";
|
||||
var desStr = "/// <summary>\n" +
|
||||
$"///{field.Description}\n" +
|
||||
"/// </summary>\n";
|
||||
fieldStrs.AppendLine(desStr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user