key1_beacon_api/ARW.WebApi/wwwroot/CodeGenTemplate/TplVoApi.txt
2023-06-05 16:59:30 +08:00

92 lines
2.6 KiB
Plaintext

using Newtonsoft.Json;
using OfficeOpenXml.Attributes;
using SqlSugar;
using System;
$if(genTable.TplCategory == "tree")
using ARW.Model.Models.Business.${genTable.moduleName};
using System.Collections.Generic;
$end
namespace ${options.DtosNamespace}.Vo.Api.${genTable.moduleName}
{
/// <summary>
/// ${genTable.FunctionName}展示对象Api
///
/// @author ${replaceDto.Author}
/// @date ${replaceDto.AddTime}
/// </summary>
public class ${replaceDto.ModelTypeName}VoApi
{
$foreach(item in genTable.Columns)
$if(item.IsInit != true)
$if((item.IsList || item.IsPk))
/// <summary>
/// 描述 :${item.ColumnComment} ${item.Remark}
/// </summary>
$if(item.IsGuid)
[JsonConverter(typeof(ValueToStringConverter))]
$if(genTable.TplCategory == "tree")
[SugarColumn(IsTreeKey = true)]
$end
$end
$if(replaceDto.ShowBtnExport)
$if(item.IsRequired && item.IsIncrement == false && item.IsPk == false)
[EpplusTableColumn(Header = "$if(item.ColumnComment == "")${item.CsharpField}${else}${item.ColumnComment}${end}"$if(item.CsharpType == "DateTime"), NumberFormat = "yyyy-MM-dd HH:mm:ss"$end)]
$else
[EpplusIgnore]
$end
$end
public $item.CsharpType$item.RequiredStr $item.CsharpField { get; set; }
$end
$end
$end
$if(genTable.TplCategory == "tree")
public string ParentName { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
[SugarColumn(IsIgnore = true)]
public List<${replaceDto.ModelTypeName}VoApi> Children { get; set; }
$end
}
/// <summary>
/// ${genTable.FunctionName}详情展示对象Api
/// </summary>
public class ${replaceDto.ModelTypeName}ApiDetailsVo
{
$foreach(item in genTable.Columns)
$if(item.IsInit != true)
$if((item.IsList || item.IsPk))
$if(item.IsGuid)
[JsonConverter(typeof(ValueToStringConverter))]
$if(genTable.TplCategory == "tree")
[SugarColumn(IsTreeKey = true)]
$end
$end
$if(replaceDto.ShowBtnExport)
$if(item.IsRequired && item.IsIncrement == false && item.IsPk == false)
[EpplusTableColumn(Header = "$if(item.ColumnComment == "")${item.CsharpField}${else}${item.ColumnComment}${end}"$if(item.CsharpType == "DateTime"), NumberFormat = "yyyy-MM-dd HH:mm:ss"$end)]
$else
[EpplusIgnore]
$end
$end
public $item.CsharpType$item.RequiredStr $item.CsharpField { get; set; }
$end
$end
$end
$if(genTable.TplCategory == "tree")
public string ParentName { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
[SugarColumn(IsIgnore = true)]
public List<${replaceDto.ModelTypeName}VoApi> Children { get; set; }
$end
}
}