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.ColumnName { get; set; } @: } } } /// /// @(@Model.BusName)分页查询输入参数 /// public class @(@Model.ClassName)Input : BasePageInput { @foreach (var column in Model.TableField){ if (@column.QueryWhether == "Y"){ @:/// @:/// @column.ColumnComment @:/// @:public @column.NetType @column.ColumnName { get; set; } @: if(@column.NetType?.TrimEnd('?') == "DateTime" && @column.QueryType == "~"){ @:/// @: /// @(@column.ColumnComment)范围 @: /// @: public List @(@column.ColumnName)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.ColumnName { get; set; } @: } } } /// /// @(@Model.BusName)删除输入参数 /// public class Delete@(@Model.ClassName)Input : BaseIdInput { @foreach (var column in Model.TableField){ if (@column.ColumnKey == "True" && @column.ColumnName != "Id"){ @:/// @:/// @column.ColumnComment @:/// @:[Required(ErrorMessage = "@(@column.ColumnComment)不能为空")] @:public @column.NetType @column.ColumnName { 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.ColumnName { get; set; } @: } } } /// /// @(@Model.BusName)主键查询输入参数 /// public class QueryById@(@Model.ClassName)Input : Delete@(@Model.ClassName)Input { }