初步完成代码级重写通用接口功能
This commit is contained in:
@@ -34,22 +34,6 @@ public class VmGetInput : VmBaseInput
|
||||
/// </summary>
|
||||
public string o { get; set; } = "*";
|
||||
|
||||
/// <summary>
|
||||
/// 转换为QueryInput
|
||||
/// </summary>
|
||||
/// <param name="primaryKey"></param>
|
||||
/// <returns></returns>
|
||||
public VmQueryInput ToQueryInput(string primaryKey)
|
||||
{
|
||||
VmQueryInput arg = this.Adapt<VmQueryInput>();
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
if (arg.q == null) arg.q = new DObject();
|
||||
arg.q.Add(primaryKey, id);
|
||||
}
|
||||
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
|
||||
public class VmGetListInput : VmBaseInput
|
||||
@@ -94,6 +78,27 @@ public class VmQueryInput : VmGetListInput
|
||||
/// 查询条件
|
||||
/// </summary>
|
||||
public new DObject? q { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 添加一个查询条件
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public void AddQueryPara(string key, object value)
|
||||
{
|
||||
if (q == null) q = new DObject();
|
||||
q.Add(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加一个查询条件
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public void AddQueryParaIf(bool condition, string key, object value)
|
||||
{
|
||||
if(condition) AddQueryPara(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -110,6 +115,11 @@ public class VmEditInput : VmBaseInput
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
public List<DObject>? items { get; set; }
|
||||
|
||||
public virtual VmEditInput ToEditInput()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Tnb.Vengine.Domain;
|
||||
[SugarTable("sys_vmodel")]
|
||||
public partial class Vmodel : Entity
|
||||
{
|
||||
public string[] SOFT_DELETED = new string[] { "deleted", "isDeleted", "softDeleted" };
|
||||
private static string[] SOFT_DELETED = new string[] { "deleted", "isDeleted", "softDeleted" };
|
||||
|
||||
#region Properties
|
||||
|
||||
@@ -88,7 +88,7 @@ public partial class Vmodel : Entity
|
||||
public int ordinal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 软删除
|
||||
/// 是否软删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "soft_delete", IsNullable = false)]
|
||||
public short softDelete { get; set; }
|
||||
@@ -103,7 +103,7 @@ public partial class Vmodel : Entity
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "deleted", IsNullable = false)]
|
||||
public short deleted { get; set; }
|
||||
public short deleted { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
|
||||
Reference in New Issue
Block a user