新增配置项
This commit is contained in:
@@ -10,7 +10,7 @@ namespace ACBuildService.Controllers;
|
||||
[SignValidation]
|
||||
public class ApiController : NBControllerBase
|
||||
{
|
||||
#region 信息增删改
|
||||
#region 视频
|
||||
|
||||
[HttpPost("list")]
|
||||
public async Task<IActionResult> List([FromForm] PageFormArgs data)
|
||||
@@ -104,6 +104,10 @@ public class ApiController : NBControllerBase
|
||||
return Success();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 信息统计
|
||||
|
||||
[HttpPost("info")]
|
||||
public async Task<IActionResult> Info()
|
||||
{
|
||||
@@ -113,11 +117,6 @@ public class ApiController : NBControllerBase
|
||||
return Success(list);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 信息统计
|
||||
|
||||
[HttpPost("device")]
|
||||
public async Task<IActionResult> Device([FromForm] DeviceFormArgs data)
|
||||
{
|
||||
@@ -158,4 +157,37 @@ public class ApiController : NBControllerBase
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 配置项目
|
||||
|
||||
[HttpPost("cfg/list")]
|
||||
public async Task<IActionResult> CfgList([FromForm] PageFormArgs data)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
var list = DB.Main.Queryable<ConfigTable>().ToList();
|
||||
return Success(list);
|
||||
}
|
||||
|
||||
[HttpPost("cfg/add")]
|
||||
public async Task<IActionResult> CfgAdd([FromForm] ConfigTable data)
|
||||
{
|
||||
await DB.Main.Insertable(data).ExecuteCommandAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("cfg/edit")]
|
||||
public async Task<IActionResult> CfgEdit([FromForm] ConfigTable data)
|
||||
{
|
||||
await DB.Main.Updateable(data).ExecuteCommandAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
[HttpPost("cfg/remove")]
|
||||
public async Task<IActionResult> CfgRemove([FromForm] KeyFormArgs data)
|
||||
{
|
||||
await DB.Main.Deleteable<ConfigTable>().Where(it => it.Key == data.Key).ExecuteCommandAsync();
|
||||
return Success();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -5,6 +5,11 @@ public class BaseFormArgs
|
||||
public string Sign { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class KeyFormArgs : BaseFormArgs
|
||||
{
|
||||
public string Key { get; set; }
|
||||
}
|
||||
|
||||
public class PageFormArgs : BaseFormArgs
|
||||
{
|
||||
public int Page { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user