142 lines
4.5 KiB
C#
142 lines
4.5 KiB
C#
using MiaoYu.Api.Admin.ApplicationServices.DevelopmentTools.LowCode.Impl;
|
|
using MiaoYu.Shared.Admin.Models.LowCodes;
|
|
|
|
namespace MiaoYu.Api.Admin.Controllers.DevelopmentTools.LowCode;
|
|
|
|
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找", DisplayName = nameof(LowCodeTableController))]
|
|
public class LowCodeTableController : AdminControllerBase<LowCodeTableService>
|
|
{
|
|
public LowCodeTableController(LowCodeTableService defaultService)
|
|
: base(defaultService)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<PagingView> FindListAsync([FromBody] PagingSearchInput<LowCodeTable> pagingSearchInput)
|
|
{
|
|
return await _defaultService.FindListAsync(pagingSearchInput);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据id数组删除
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<bool> DeleteListAsync([FromBody] List<Guid> ids)
|
|
{
|
|
await _defaultService.DeleteListAsync(ids);
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 同步表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Task SynchronizationAsync()
|
|
{
|
|
return _defaultService.SynchronizationAsync();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据表名和数据库标识变更表配置(推荐使用)
|
|
/// </summary>
|
|
/// <param name="input">变更参数,包含表配置列表</param>
|
|
/// <returns>保存成功返回 true</returns>
|
|
[HttpPost]
|
|
public Task<bool> ChangeByTableAsync([FromBody] TableChangeInput input)
|
|
{
|
|
return _defaultService.ChangeByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 变更数据
|
|
/// </summary>
|
|
/// <param name="lowCodeTables"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Obsolete("请使用 ChangeByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task ChangeAsync([FromBody] List<LowCodeTable> lowCodeTables)
|
|
{
|
|
return _defaultService.ChangeAsync(lowCodeTables);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据表名和数据库标识查询表单数据(推荐使用)
|
|
/// </summary>
|
|
/// <param name="input">查询参数,包含表名和数据库标识</param>
|
|
/// <returns>表单数据字典</returns>
|
|
[ActionDescriptor(DisplayName = "查询数据")]
|
|
[HttpPost]
|
|
public Task<Dictionary<string, object>> FindFormByTableAsync([FromBody] TableFormQueryInput input)
|
|
{
|
|
return _defaultService.FindFormByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询表单数据
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[ActionDescriptor(DisplayName = "查询数据")]
|
|
[HttpGet("{id?}")]
|
|
[Obsolete("请使用 FindFormByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task<Dictionary<string, object>> FindFormAsync([FromRoute] Guid id)
|
|
{
|
|
return _defaultService.FindFormAsync(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据表名和数据库标识保存表单数据(推荐使用)
|
|
/// </summary>
|
|
/// <param name="input">保存参数,包含表名、数据库标识和配置信息</param>
|
|
/// <returns>保存成功返回 true</returns>
|
|
[RequestLimitFilter]
|
|
[ActionDescriptor(DisplayName = "保存表单")]
|
|
[HttpPost]
|
|
[ApiCheckModel]
|
|
public Task<bool> SaveFormByTableAsync([FromBody] TableFormSaveInput input)
|
|
{
|
|
return _defaultService.SaveFormByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")]
|
|
[HttpPost]
|
|
[ApiCheckModel]
|
|
[Obsolete("请使用 SaveFormByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task CreateAsync([FromBody] LowCodeTable form)
|
|
{
|
|
return _defaultService.SaveFormAsync(form);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")]
|
|
[HttpPost]
|
|
[ApiCheckModel]
|
|
[Obsolete("请使用 SaveFormByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task UpdateAsync([FromBody] LowCodeTable form)
|
|
{
|
|
return _defaultService.SaveFormAsync(form);
|
|
}
|
|
|
|
|
|
|
|
} |