修复清理vengine
This commit is contained in:
@@ -13,4 +13,4 @@ namespace Tnb.Vengine.AppService;
|
||||
/// </summary>
|
||||
public class BaseAppService : IDynamicApiController, ITransient
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,4 @@ namespace Tnb.Vengine.AppService;
|
||||
/// </summary>
|
||||
public interface IVengineAppService : ITransient
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,4 @@ namespace Tnb.Vengine.AppService;
|
||||
/// </summary>
|
||||
public interface IVmodelAppService : ITransient
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,4 @@ namespace Tnb.Vengine.AppService;
|
||||
/// </summary>
|
||||
public interface IVmodelPageAppService : ITransient
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取一条 数据信息
|
||||
/// </summary>
|
||||
[HttpGet("api/[area]/[controller]/{vmid}/get")]
|
||||
public async Task<dynamic?> GetAsync(string vmid, VmGetInput input)
|
||||
public async Task<dynamic?> GetAsync(string vmid, [FromQuery]VmGetInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid, true);
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -57,7 +57,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpGet("api/[area]/[controller]/{vmid}/get-list")]
|
||||
public async Task<VmPagedOutput> GetListAsync(string vmid, VmGetListInput input)
|
||||
public async Task<VmPagedOutput> GetListAsync(string vmid, [FromQuery] VmGetListInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid, true);
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -73,7 +73,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpPost("api/[area]/[controller]/{vmid}/query")]
|
||||
public async Task<VmPagedOutput> QueryAsync(string vmid, VmQueryInput input)
|
||||
public async Task<VmPagedOutput> QueryAsync(string vmid, [FromBody] VmQueryInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid, true);
|
||||
var ls = await _dataAccess.QueryDataAsync(vm, input);
|
||||
@@ -84,7 +84,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 新增 数据
|
||||
/// </summary>
|
||||
[HttpPost("api/[area]/[controller]/{vmid}/create")]
|
||||
public async Task<dynamic> CreateAsync(string vmid, VmCreateInput input)
|
||||
public async Task<dynamic> CreateAsync(string vmid, [FromBody] VmCreateInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid);
|
||||
var ret = await _dataAccess.CreateDataAsync(vm, input);
|
||||
@@ -95,7 +95,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 更新 数据
|
||||
/// </summary>
|
||||
[HttpPut("api/[area]/[controller]/{vmid}/update")]
|
||||
public async Task<dynamic> UpdateAsync(string vmid, VmUpdateInput input)
|
||||
public async Task<dynamic> UpdateAsync(string vmid, [FromBody] VmUpdateInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid);
|
||||
var ret = await _dataAccess.UpdateDataAsync(vm, input);
|
||||
@@ -106,19 +106,20 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 删除 数据
|
||||
/// </summary>
|
||||
[HttpDelete("api/[area]/[controller]/{vmid}/delete")]
|
||||
public async Task<dynamic> DeleteAsync(string vmid, VmDeleteInput input)
|
||||
public async Task<dynamic> DeleteAsync(string vmid, [FromQuery] VmDeleteInput input)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(vmid);
|
||||
var ret = await _dataAccess.DeleteDataAsync(vm, input);
|
||||
return ret;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion 按模型的id进行增删改查接口
|
||||
|
||||
#region 按模型的areaCode和vmcode进行增删改查接口
|
||||
|
||||
private async Task<Vmodel> GetVmodelAsync(string areaCode, string vmCode)
|
||||
{
|
||||
var vm = await _dataAccess.GetVmodelAsync(areaCode, vmCode, false);
|
||||
var vm = await _dataAccess.GetVmodelAsync(areaCode, vmCode, true);
|
||||
return vm;
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取一条 数据信息
|
||||
/// </summary>
|
||||
[HttpGet("api/{areaCode}/{vmCode}/get")]
|
||||
public async Task<dynamic?> GetAsync(string areaCode, string vmCode, VmGetInput input)
|
||||
public async Task<dynamic?> GetAsync(string areaCode, string vmCode, [FromQuery] VmGetInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -143,7 +144,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpGet("api/{areaCode}/{vmCode}/get-list")]
|
||||
public async Task<VmPagedOutput> GetListAsync(string areaCode, string vmCode, VmGetListInput input)
|
||||
public async Task<VmPagedOutput> GetListAsync(string areaCode, string vmCode, [FromQuery] VmGetListInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -159,7 +160,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpPost("api/{areaCode}/{vmCode}/query")]
|
||||
public async Task<VmPagedOutput> QueryAsync(string areaCode, string vmCode, VmQueryInput input)
|
||||
public async Task<VmPagedOutput> QueryAsync(string areaCode, string vmCode, [FromBody] VmQueryInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
var ls = await _dataAccess.QueryDataAsync(vm, input);
|
||||
@@ -170,7 +171,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 新增 数据
|
||||
/// </summary>
|
||||
[HttpPost("api/{areaCode}/{vmCode}/create")]
|
||||
public async Task<dynamic> CreateAsync(string areaCode, string vmCode, VmCreateInput input)
|
||||
public async Task<dynamic> CreateAsync(string areaCode, string vmCode, [FromBody] VmCreateInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
var ret = await _dataAccess.CreateDataAsync(vm, input);
|
||||
@@ -181,7 +182,7 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 更新 数据
|
||||
/// </summary>
|
||||
[HttpPut("api/{areaCode}/{vmCode}/update")]
|
||||
public async Task<dynamic> UpdateAsync(string areaCode, string vmCode, VmUpdateInput input)
|
||||
public async Task<dynamic> UpdateAsync(string areaCode, string vmCode, [FromBody] VmUpdateInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
var ret = await _dataAccess.UpdateDataAsync(vm, input);
|
||||
@@ -192,12 +193,12 @@ public class VengineAppService : BaseAppService, IVengineAppService
|
||||
/// 删除 数据
|
||||
/// </summary>
|
||||
[HttpDelete("api/{areaCode}/{vmCode}/delete")]
|
||||
public async Task<dynamic> DeleteAsync(string areaCode, string vmCode, VmDeleteInput input)
|
||||
public async Task<dynamic> DeleteAsync(string areaCode, string vmCode, [FromQuery] VmDeleteInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync(areaCode, vmCode);
|
||||
var ret = await _dataAccess.DeleteDataAsync(vm, input);
|
||||
return ret;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion 按模型的areaCode和vmcode进行增删改查接口
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System.Reflection;
|
||||
using JNPF;
|
||||
using JNPF.Common.Security;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -64,7 +63,7 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 获取一条 数据信息
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
public virtual async Task<dynamic> GetAsync(VmGetInput input)
|
||||
public virtual async Task<dynamic> GetAsync([FromQuery] VmGetInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -81,7 +80,7 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpGet]
|
||||
public virtual async Task<VmPagedOutput> GetListAsync(VmGetListInput input)
|
||||
public virtual async Task<VmPagedOutput> GetListAsync([FromQuery] VmGetListInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
VmQueryInput arg = input.Adapt<VmQueryInput>();
|
||||
@@ -97,7 +96,7 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 获取多条 数据列表
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public virtual async Task<VmPagedOutput> QueryAsync(VmQueryInput input)
|
||||
public virtual async Task<VmPagedOutput> QueryAsync([FromBody] VmQueryInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
var ls = await _dataAccess.QueryDataAsync(vm, input);
|
||||
@@ -108,7 +107,7 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 新增 数据
|
||||
/// </summary>
|
||||
[HttpPost]
|
||||
public virtual async Task<dynamic> CreateAsync(VmCreateInput input)
|
||||
public virtual async Task<dynamic> CreateAsync([FromBody] VmCreateInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
var ret = await _dataAccess.CreateDataAsync(vm, input);
|
||||
@@ -119,7 +118,7 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 更新 数据
|
||||
/// </summary>
|
||||
[HttpPut]
|
||||
public virtual async Task<dynamic> UpdateAsync(VmUpdateInput input)
|
||||
public virtual async Task<dynamic> UpdateAsync([FromBody] VmUpdateInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
var ret = await _dataAccess.UpdateDataAsync(vm, input);
|
||||
@@ -130,11 +129,10 @@ public class VengineAppService<TEntity> : BaseAppService where TEntity : Entity
|
||||
/// 删除 数据
|
||||
/// </summary>
|
||||
[HttpDelete]
|
||||
public virtual async Task<dynamic> DeleteAsync(VmDeleteInput input)
|
||||
public virtual async Task<dynamic> DeleteAsync([FromQuery] VmDeleteInput input)
|
||||
{
|
||||
var vm = await GetVmodelAsync();
|
||||
var ret = await _dataAccess.DeleteDataAsync(vm, input);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,13 @@
|
||||
// https://git.tuotong-tech.com/tnb/tnb-server //
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF;
|
||||
using JNPF.ViewEngine;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.Core;
|
||||
using Tnb.Vengine.DataAccess;
|
||||
using Tnb.Vengine.Domain;
|
||||
using JNPF.ViewEngine;
|
||||
|
||||
namespace Tnb.Vengine.AppService;
|
||||
|
||||
@@ -22,11 +20,12 @@ namespace Tnb.Vengine.AppService;
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
|
||||
{
|
||||
private readonly ViewEngine _viewEngine;
|
||||
private readonly IViewEngine _viewEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public VmodelAppService(IDataAccess da, ViewEngine viewEngine) : base(da)
|
||||
public VmodelAppService(IDataAccess da, IViewEngine viewEngine) : base(da)
|
||||
{
|
||||
_viewEngine = viewEngine;
|
||||
}
|
||||
@@ -221,8 +220,6 @@ public class VmodelAppService : VengineAppService<Vmodel>, IVmodelAppService
|
||||
//code = CodeHelper.RunCompile($"{TemplateContext.KeyEntityPageVue}.cshtml", ctx, null, "SqlSugar");
|
||||
//CodeHelper.SaveCodeToFile(code, filePath);
|
||||
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,4 @@ public class VmodelGetInput
|
||||
public string? dbCode { get; set; }
|
||||
public string? tableName { get; set; }
|
||||
public bool drill { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,14 +3,12 @@
|
||||
// https://git.tuotong-tech.com/tnb/tnb-server //
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using System.Text;
|
||||
using JNPF.Common.Security;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using System.Text;
|
||||
using Tnb.Core;
|
||||
using Tnb.Vengine.DataAccess;
|
||||
using Tnb.Vengine.Domain;
|
||||
|
||||
@@ -167,5 +165,4 @@ public class VmodelPageAppService : VengineAppService<VmodelPage>, IVmodelPageAp
|
||||
Console.WriteLine(s);
|
||||
return JObject.Parse(s);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user