using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
namespace @Model.NameSpace;
///
/// @(@Model.BusName)基础输入参数
///
public class @(@Model.ClassName)BaseInput
{
@foreach (var column in Model.TableField){
if (@column.ColumnKey != "True"){
@:///
@:/// @column.ColumnComment
@:///
@:public virtual @column.NetType @column.PropertyName { get; set; }
@:
}
}
}
///
/// @(@Model.BusName)分页查询输入参数
///
public class @(@Model.ClassName)Input : BasePageInput
{
///
/// 关键字查询
///
public string? SearchKey { get; set; }
@foreach (var column in Model.TableField){
if (@column.QueryWhether == "Y"){
@:///
@:/// @column.ColumnComment
@:///
if(@column.NetType?.EndsWith("?") == true){
@:public @column.NetType @column.PropertyName { get; set; }
}else {
@:public @(@column.NetType)? @column.PropertyName { get; set; }
}
@:
if(@column.NetType?.TrimEnd('?') == "DateTime" && @column.QueryType == "~"){
@:///
@: /// @(@column.ColumnComment)范围
@: ///
@: public List @(@column.PropertyName)Range { get; set; }
}
}
}
}
///
/// @(@Model.BusName)增加输入参数
///
public class Add@(@Model.ClassName)Input : @(@Model.ClassName)BaseInput
{
@foreach (var column in Model.TableField){
if (@column.WhetherRequired == "Y"){
@:///
@:/// @column.ColumnComment
@:///
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
@:public override @column.NetType @column.PropertyName { get; set; }
@:
}
}
}
///
/// @(@Model.BusName)删除输入参数
///
public class Delete@(@Model.ClassName)Input : BaseIdInput
{
@foreach (var column in Model.TableField){
if (@column.ColumnKey == "True" && @column.PropertyName != "Id"){
@:///
@:/// @column.ColumnComment
@:///
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
@:public @column.NetType @column.PropertyName { get; set; }
@:
}
}
}
///
/// @(@Model.BusName)更新输入参数
///
public class Update@(@Model.ClassName)Input : @(@Model.ClassName)BaseInput
{
@foreach (var column in Model.TableField){
if (@column.ColumnKey == "True"){
@:///
@:/// @column.ColumnComment
@:///
@:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")]
@:public @column.NetType @column.PropertyName { get; set; }
@:
}
}
}
///
/// @(@Model.BusName)主键查询输入参数
///
public class QueryById@(@Model.ClassName)Input : Delete@(@Model.ClassName)Input
{
}