新增配置项
This commit is contained in:
3
.idea/.idea.ACBuildService/.idea/workspace.xml
generated
3
.idea/.idea.ACBuildService/.idea/workspace.xml
generated
@@ -84,6 +84,7 @@
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/59cd7a17e4fcffda1ba3687b386939b4e155ba482f85c8fe9993bc8373d7f93/ApiBehaviorApplicationModelProvider.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/9492f6e132137ff2698b3268c9c422a578e49c5893a8371ed19fb0695fd5925/AbstractDownloadService.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Db/DB.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Db/Tables/ConfigTable.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Db/Tables/DeviceTable.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Db/Tables/VideoTable.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/Http/Extensions/DateTimeExtensions.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
@@ -175,7 +176,7 @@
|
||||
<updated>1768872588133</updated>
|
||||
<workItem from="1768872589085" duration="31265000" />
|
||||
<workItem from="1769505886159" duration="1492000" />
|
||||
<workItem from="1770512793250" duration="25168000" />
|
||||
<workItem from="1770512793250" duration="25794000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
1
Db/DB.cs
1
Db/DB.cs
@@ -30,5 +30,6 @@ public static class DB
|
||||
//建表
|
||||
Main.CodeFirst.InitTables<VideoTable>();
|
||||
Main.CodeFirst.InitTables<DeviceTable>();
|
||||
Main.CodeFirst.InitTables<ConfigTable>();
|
||||
}
|
||||
}
|
||||
15
Db/Tables/ConfigTable.cs
Normal file
15
Db/Tables/ConfigTable.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ACBuildService;
|
||||
|
||||
[SugarTable("cfg")]
|
||||
public class ConfigTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string Key { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
@@ -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