96 lines
3.3 KiB
C#
96 lines
3.3 KiB
C#
using MiaoYu.Api.Admin.ApplicationServices.DevelopmentTools.LowCode.Impl;
|
|
using MiaoYu.Shared.Admin.Models.LowCodes;
|
|
using MiaoYu.Repository.Admin.Entities.LowCode;
|
|
|
|
namespace MiaoYu.Api.Admin.Controllers.DevelopmentTools.LowCode;
|
|
|
|
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找", DisplayName = nameof(LowCodeTableInfoController))]
|
|
public class LowCodeTableInfoController : AdminControllerBase<LowCodeTableInfoService>
|
|
{
|
|
public LowCodeTableInfoController(LowCodeTableInfoService defaultService)
|
|
: base(defaultService)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据表名和数据库标识获取列列表(推荐使用)
|
|
/// </summary>
|
|
/// <param name="input">查询参数,包含表名和数据库标识</param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Task<PagingView> FindListByTableAsync([FromBody] TableColumnQueryInput input)
|
|
{
|
|
return _defaultService.FindListByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Obsolete("请使用 FindListByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public async Task<PagingView> FindListAsync([FromBody] PagingSearchInput<LowCodeTableInfo> 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>
|
|
/// <param name="input">同步参数,包含表名和数据库标识</param>
|
|
/// <returns>同步成功返回 true</returns>
|
|
[HttpPost]
|
|
public Task<bool> SynchronizationByTableAsync([FromBody] TableSyncInput input)
|
|
{
|
|
return _defaultService.SynchronizationByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 同步表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("{tableId}")]
|
|
[Obsolete("请使用 SynchronizationByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task SynchronizationAsync([FromRoute] Guid tableId)
|
|
{
|
|
return _defaultService.SynchronizationColumnByTableIdAsync(tableId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据表名和数据库标识变更列配置(推荐使用)
|
|
/// </summary>
|
|
/// <param name="input">修改参数,包含表名、数据库标识和列配置列表</param>
|
|
/// <returns>保存成功返回 true</returns>
|
|
[HttpPost]
|
|
public Task<bool> ChangeByTableAsync([FromBody] TableColumnChangeInput input)
|
|
{
|
|
return _defaultService.ChangeByTableAsync(input);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 变更数据
|
|
/// </summary>
|
|
/// <param name="lowCodeTableInfos"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Obsolete("请使用 ChangeByTableAsync 接口,该接口使用 TableName + DataBase 作为查询参数")]
|
|
public Task ChangeAsync([FromBody] List<LowCodeTableInfo> lowCodeTableInfos)
|
|
{
|
|
return _defaultService.ChangeAsync(lowCodeTableInfos);
|
|
}
|
|
|
|
} |