DigitalFactory/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Output.cs.vm

59 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-03-18 01:36:19 +00:00
namespace @Model.NameSpace;
/// <summary>
/// @(@Model.BusName)输出参数
/// </summary>
public class @(@Model.ClassName)Output
{
@foreach (var column in Model.TableField){
@:/// <summary>
@:/// @column.ColumnComment
@:/// </summary>
if(column.EffectType == "fk")
{
@:public @column.NetType @column.PropertyName { get; set; }
@:
@:/// <summary>
@:/// @(column.ColumnComment) 描述
@:/// </summary>
@:public @(@column.FkColumnNetType) @(@column.PropertyName)@(@column.FkColumnName) { get; set; }
}else if(column.EffectType == "Upload"){
@:public @column.NetType @column.PropertyName { get; set; }
@:public SysFile @(@column.PropertyName)Attachment { get; set; }
}else if(column.EffectType == "ApiTreeSelect"){
@:public @column.NetType @column.PropertyName { get; set; }
@:
@:/// <summary>
@:/// @(column.ColumnComment) 描述
@:/// </summary>
@:public string? @(@column.PropertyName)@(@column.DisplayColumn) { get; set; }
}else{
@:public @column.NetType @(@column.PropertyName) { get; set; }
}
@:
}
}
@foreach (var column in Model.TableField){
if (@column.EffectType == "ApiTreeSelect"){
@:// 使用实际实体@(@column.FkTableName),所以这里就删了
@:/*
@:[SugarTable("@(@column.FkTableName)")]
@:public class @(@column.FkEntityName)TreeOutput: EntityBaseId
@:{
@:[SugarColumn(ColumnName = "@(@column.DisplayColumn)")]
@:public @(@Model.GetColumnNetType(@column.FkTableName,@column.DisplayColumn)) Label { get; set; }
@:[SugarColumn(ColumnName = "@(@column.ValueColumn)", IsPrimaryKey = true, IsIdentity = false)]
@:public @(@Model.GetColumnNetType(@column.FkTableName,@column.ValueColumn)) Value { get; set; }
@:public @(@Model.GetColumnNetType(@column.FkTableName,@column.PidColumn)) @column.PidColumn { get; set; }
@:[SugarColumn(IsIgnore = true)]
@:public List<@(@column.FkEntityName)TreeOutput> Children { get; set; }
@:}
@:*/
}
}