diff --git a/.idea/.idea.ACBuildService/.idea/workspace.xml b/.idea/.idea.ACBuildService/.idea/workspace.xml
index 3f52b0b..dd69e0f 100644
--- a/.idea/.idea.ACBuildService/.idea/workspace.xml
+++ b/.idea/.idea.ACBuildService/.idea/workspace.xml
@@ -84,6 +84,7 @@
+
@@ -175,7 +176,7 @@
1768872588133
-
+
diff --git a/Db/DB.cs b/Db/DB.cs
index de6088a..33aeaf6 100644
--- a/Db/DB.cs
+++ b/Db/DB.cs
@@ -30,5 +30,6 @@ public static class DB
//建表
Main.CodeFirst.InitTables();
Main.CodeFirst.InitTables();
+ Main.CodeFirst.InitTables();
}
}
\ No newline at end of file
diff --git a/Db/Tables/ConfigTable.cs b/Db/Tables/ConfigTable.cs
new file mode 100644
index 0000000..aef9d53
--- /dev/null
+++ b/Db/Tables/ConfigTable.cs
@@ -0,0 +1,15 @@
+using SqlSugar;
+
+namespace ACBuildService;
+
+[SugarTable("cfg")]
+public class ConfigTable
+{
+ ///
+ /// 设备id
+ ///
+ [SugarColumn(IsPrimaryKey = true)]
+ public string Key { get; set; }
+
+ public string Value { get; set; }
+}
\ No newline at end of file
diff --git a/Http/Page/ApiController.cs b/Http/Page/ApiController.cs
index 353bf9a..64a75fd 100644
--- a/Http/Page/ApiController.cs
+++ b/Http/Page/ApiController.cs
@@ -10,7 +10,7 @@ namespace ACBuildService.Controllers;
[SignValidation]
public class ApiController : NBControllerBase
{
- #region 信息增删改
+ #region 视频
[HttpPost("list")]
public async Task List([FromForm] PageFormArgs data)
@@ -104,6 +104,10 @@ public class ApiController : NBControllerBase
return Success();
}
+ #endregion
+
+ #region 信息统计
+
[HttpPost("info")]
public async Task Info()
{
@@ -113,11 +117,6 @@ public class ApiController : NBControllerBase
return Success(list);
}
- #endregion
-
-
- #region 信息统计
-
[HttpPost("device")]
public async Task Device([FromForm] DeviceFormArgs data)
{
@@ -158,4 +157,37 @@ public class ApiController : NBControllerBase
}
#endregion
+
+ #region 配置项目
+
+ [HttpPost("cfg/list")]
+ public async Task CfgList([FromForm] PageFormArgs data)
+ {
+ await Task.CompletedTask;
+ var list = DB.Main.Queryable().ToList();
+ return Success(list);
+ }
+
+ [HttpPost("cfg/add")]
+ public async Task CfgAdd([FromForm] ConfigTable data)
+ {
+ await DB.Main.Insertable(data).ExecuteCommandAsync();
+ return Success();
+ }
+
+ [HttpPost("cfg/edit")]
+ public async Task CfgEdit([FromForm] ConfigTable data)
+ {
+ await DB.Main.Updateable(data).ExecuteCommandAsync();
+ return Success();
+ }
+
+ [HttpPost("cfg/remove")]
+ public async Task CfgRemove([FromForm] KeyFormArgs data)
+ {
+ await DB.Main.Deleteable().Where(it => it.Key == data.Key).ExecuteCommandAsync();
+ return Success();
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/Http/Page/Args.cs b/Http/Page/Args.cs
index 7d05952..67e8ef6 100644
--- a/Http/Page/Args.cs
+++ b/Http/Page/Args.cs
@@ -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; }