完善模型通用接口的无限层级一对一和单层级一对多
This commit is contained in:
@@ -9,6 +9,7 @@ using JNPF.ViewEngine;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.Core;
|
||||
using Tnb.Vengine.DataAccess;
|
||||
using Tnb.Vengine.Domain;
|
||||
|
||||
@@ -65,12 +66,12 @@ public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
|
||||
RefAsync<int> total = 0;
|
||||
var data = await q.OrderBy(input.sort).ToPageListAsync((input.pnum - 1) * input.psize, input.psize, total);
|
||||
ret.total = total;
|
||||
ret.items = data.ConvertAll<dynamic>(a => a);
|
||||
ret.items = data.Adapt<List<DObject>>();
|
||||
return ret;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<VmPagedOutput> ListAsync(VmListInput input)
|
||||
public override Task<VmPagedOutput> ListAsync(VmQueryInput input)
|
||||
{
|
||||
return base.ListAsync(input);
|
||||
}
|
||||
@@ -127,12 +128,17 @@ public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
|
||||
foreach (var tb in lsTable)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(input.removePrefix) && !tb.Name.StartsWith(input.removePrefix)) continue;
|
||||
var n = tb.Name.IndexOf('_');
|
||||
if (string.IsNullOrEmpty(input.removePrefix) && n > 0 && n < 5)
|
||||
{
|
||||
input.removePrefix = tb.Name.Substring(0, n);
|
||||
}
|
||||
var colInfo = sugar.DbMaintenance.GetColumnInfosByTableName(tb.Name);
|
||||
Vmodel model = new() { dbCode = input.dbCode, vmName = tb.Description, tableName = tb.Name };
|
||||
model.areaCode = input.areaCode.ToKebab();
|
||||
model.vmCode = (string.IsNullOrEmpty(input.removePrefix) ? tb.Name.ToKebab() : tb.Name.RemovePreFix(input.removePrefix)).ToKebab();
|
||||
//model.createId = CurrentUser.Id;
|
||||
int n = 1;
|
||||
n = 1;
|
||||
foreach (var p in colInfo)
|
||||
{
|
||||
var prop = p.Adapt<VmDbProp>();
|
||||
|
||||
Reference in New Issue
Block a user