完善通用接口输入参数
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// https://git.tuotong-tech.com/tnb/tnb-server //
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using JNPF;
|
||||
using JNPF.Common.Security;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -40,10 +41,10 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
public async Task<dynamic?> GetAsync(string vmid, [FromQuery] VmGetInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(vmid);
|
||||
var arg = input.Adapt<VmQueryInput>();
|
||||
arg.AddQueryParaIf(!string.IsNullOrEmpty(input.id), vm.GetPrimary().code, input.id!);
|
||||
if (!string.IsNullOrEmpty(input.id)) input.q.Add(vm.GetPrimary().code, input.id);
|
||||
input.LoadFromHttpContext(App.HttpContext);
|
||||
|
||||
var ls = await ListAsync(vmid, arg);
|
||||
var ls = await ListAsync(vmid, input.Adapt<VmQueryInput>());
|
||||
return ls.items.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -51,9 +52,10 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpGet("api/[area]/[controller]/{vmid}/get-list")]
|
||||
public async Task<VmPagedOutput> GetListAsync(string vmid, [FromQuery] VmGetListInput input)
|
||||
public async Task<VmPagedOutput> GetListAsync(string vmid, [FromQuery] VmQueryInput input)
|
||||
{
|
||||
return await ListAsync(vmid, input.Adapt<VmQueryInput>());
|
||||
input.LoadFromHttpContext(App.HttpContext);
|
||||
return await ListAsync(vmid, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -110,10 +112,10 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
public async Task<dynamic?> GetAsync(string areaCode, string vmCode, [FromQuery] VmGetInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
var arg = input.Adapt<VmQueryInput>();
|
||||
arg.AddQueryParaIf(!string.IsNullOrEmpty(input.id), vm.GetPrimary().code, input.id!);
|
||||
if (!string.IsNullOrEmpty(input.id)) input.q.Add(vm.GetPrimary().code, input.id);
|
||||
input.LoadFromHttpContext(App.HttpContext);
|
||||
|
||||
var ls = await ListAsync(areaCode, vmCode, arg);
|
||||
var ls = await ListAsync(areaCode, vmCode, input.Adapt<VmQueryInput>());
|
||||
return ls.items.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -121,9 +123,10 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpGet("api/{areaCode}/{vmCode}/get-list")]
|
||||
public async Task<VmPagedOutput> GetListAsync(string areaCode, string vmCode, [FromQuery] VmGetListInput input)
|
||||
public async Task<VmPagedOutput> GetListAsync(string areaCode, string vmCode, [FromQuery] VmQueryInput input)
|
||||
{
|
||||
return await ListAsync(areaCode, vmCode, input.Adapt<VmQueryInput>());
|
||||
input.LoadFromHttpContext(App.HttpContext);
|
||||
return await ListAsync(areaCode, vmCode, input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user