diff --git a/VideoAnalysis/Components/Pages/VideoTaskPage.razor b/VideoAnalysis/Components/Pages/VideoTaskPage.razor
index 8e649fb..dee6bd8 100644
--- a/VideoAnalysis/Components/Pages/VideoTaskPage.razor
+++ b/VideoAnalysis/Components/Pages/VideoTaskPage.razor
@@ -1,12 +1,13 @@
锘緻page "/"
-@using AntDesign
-@using AntDesign.TableModels
-@using System.ComponentModel.DataAnnotations
-@using Learn.VideoAnalysis.Controllers.Dto
-@using SqlSugar
-@using VideoAnalysisCore.Model
-@using VideoAnalysisCore.Model.Dto
-@using VideoAnalysisCore.Enum
+@ using AntDesign
+@ using AntDesign.TableModels
+@ using System.ComponentModel.DataAnnotations
+@ using Learn.VideoAnalysis.Controllers.Dto
+@ using SqlSugar
+@ using VideoAnalysisCore.Model
+@ using VideoAnalysisCore.Model.Dto
+@ using VideoAnalysisCore.Enum;
+ using VideoAnalysisCore.Model.Enum
AudioRecognition(IFormFile file)
{
- using var s = file.OpenReadStream();
+ using var s = file.OpenReadStream();
var res = await SenseVoice.RunTask(s);
return Ok(res);
}
@@ -83,7 +84,7 @@ namespace Learn.VideoAnalysis.Controllers
/// 路径
///
[HttpGet(Name = "fts_data")]
- public async Task FTS_Data(string path= "itn_subject_sx.fst")
+ public async Task FTS_Data(string path = "itn_subject_sx.fst")
{
var hotwords = JsonSerializer
.Deserialize(System.IO.File.ReadAllText(Path.Combine(AppCommon.AIModelFile, "Hotwords.json")));
@@ -115,7 +116,7 @@ namespace Learn.VideoAnalysis.Controllers
.FirstAsync();
if (task is null)
return BadRequest("未能找到对应任务");
- if (subject is not null)
+ if (subject is not null)
{
task.Subject = subject;
await videoTaskDB.UpdateAsync(task);
@@ -134,7 +135,7 @@ namespace Learn.VideoAnalysis.Controllers
///
///
[HttpPost(Name = "TestInsertChannel")]
- public IActionResult TestInsertChannel(int @enum=1, string msg= "1")
+ public IActionResult TestInsertChannel(int @enum = 1, string msg = "1")
{
RedisExpand.InsertChannel(@enum.ToEnum().Value
, msg);
@@ -149,12 +150,12 @@ namespace Learn.VideoAnalysis.Controllers
[HttpPost(Name = "VideoAnalysis")]
public async Task VideoAnalysis(VideoAnalysisReq req)
{
- if (!ModelState.IsValid) return BadRequest(ModelState);
+ if (!ModelState.IsValid) return BadRequest(ModelState);
- if(await videoTaskDB.IsAnyAsync(s=>s.TagId == req.TagId) )
+ if (await videoTaskDB.IsAnyAsync(s => s.TagId == req.TagId))
return BadRequest("重复添加");
// 自动映射属性到哈希
- var task = new VideoTask()
+ var task = new VideoTask()
{
ComeFrom = GetClientIpAddress(),
MediaUrl = req.MediaUrl,
@@ -172,30 +173,10 @@ namespace Learn.VideoAnalysis.Controllers
.ToDictionary(s => s.Name, s => s.GetValue(task));
RedisExpand.Redis.HMSet(RedisExpandKey.Task(task.Id), hashEntries);
RedisExpand.Redis.LPush(RedisExpandKey.ChannelKey, task.Id);
- return Ok(task.Id);
+ return Ok(task.Id);
}
- ///
- /// 蓝鲸智库_添加文件节点监控
- ///
- /// 请求体
- ///
- [HttpPost(Name = "ZY_NodeMonitoring")]
- public async Task ZY_NodeMonitoring(NodeMonitoringReq req)
- {
- //if (!ModelState.IsValid) return BadRequest(ModelState);
-
- //入库
- //task.Id = await videoTaskDB.InsertReturnBigIdentityAsync(task);
- //var hashEntries = task.GetType()
- // .GetProperties(BindingFlags.Public | BindingFlags.Instance)
- // .ToDictionary(s => s.Name, s => s.GetValue(task));
- //RedisExpand.Redis.HMSet(RedisExpandKey.Task(task.Id), hashEntries);
- //RedisExpand.Redis.LPush(RedisExpandKey.ChannelKey, task.Id);
- return Ok();
- }
-
diff --git a/VideoAnalysis/Controllers/Dto/ApiDto.cs b/VideoAnalysis/Controllers/Dto/ApiDto.cs
index 7784f6f..512610d 100644
--- a/VideoAnalysis/Controllers/Dto/ApiDto.cs
+++ b/VideoAnalysis/Controllers/Dto/ApiDto.cs
@@ -3,7 +3,7 @@ using SqlSugar;
using System.ComponentModel.DataAnnotations;
using UserCenter.Model.Enum;
using VideoAnalysisCore.AICore.GPT.Dto;
-using VideoAnalysisCore.Enum;
+using VideoAnalysisCore.Model.Enum;
namespace Learn.VideoAnalysis.Controllers.Dto
{
@@ -16,15 +16,11 @@ namespace Learn.VideoAnalysis.Controllers.Dto
/// 濯掍綋璺緞
///
[Required(ErrorMessage = "鏂囦欢鑺傜偣ID鏄繀濉」")]
- public string NodeId { get; set; } = string.Empty;
+ public long NodeId { get; set; }
///
/// 浠诲姟绫诲瀷
///
public TaskTypeEnum? Type { get; set; }
- ///
- /// 鑷畾涔夊 浠诲姟瀹屾垚鍚庨檮甯﹂氱煡
- ///
- public string Tag { get; set; } = string.Empty;
}
///
diff --git a/VideoAnalysis/Controllers/LJZK_Controller.cs b/VideoAnalysis/Controllers/LJZK_Controller.cs
new file mode 100644
index 0000000..5efa27e
--- /dev/null
+++ b/VideoAnalysis/Controllers/LJZK_Controller.cs
@@ -0,0 +1,74 @@
+
+using VideoAnalysisCore.Common;
+using Microsoft.AspNetCore.Mvc;
+using System.Reflection;
+using MapsterMapper;
+using Mapster;
+using VideoAnalysisCore.AICore.SherpaOnnx;
+using UserCenter.Model.Enum;
+using VideoAnalysisCore.AICore.GPT.ChatGPT;
+using VideoAnalysisCore.AICore.GPT;
+using System.Text.Json;
+using Microsoft.AspNetCore.Authorization;
+using VideoAnalysisCore.Model.Enum;
+
+namespace Learn.VideoAnalysis.Controllers
+{
+ ///
+ /// 蓝鲸字库接口
+ ///
+ [ApiController]
+ [Route("LJZK/[action]")]
+ public class LJZK_Controller : ControllerBase
+ {
+ private readonly ILogger _logger;
+ private readonly IMapper mp;
+ private readonly Repository nodesubscriptionDB;
+ private readonly IBserGPT chatGPT;
+ public LJZK_Controller(ILogger logger,
+ IMapper mp, IBserGPT chatGPT, Repository nodesubscriptionDB)
+ {
+ _logger = logger;
+ this.mp = mp;
+ this.chatGPT = chatGPT;
+ this.nodesubscriptionDB = nodesubscriptionDB;
+ }
+
+
+ ///
+ /// 蓝鲸智库_添加文件节点监控
+ ///
+ /// 请求体
+ ///
+ [HttpPost(Name = "NodeSubscription")]
+ public async Task NodeSubscription(NodeMonitoringReq req)
+ {
+ if (nodesubscriptionDB.IsAny(s => s.NodeId == req.NodeId))
+ return BadRequest("重复添加了节点监控任务" + req.NodeId);
+ var res = await nodesubscriptionDB.InsertReturnEntityAsync(new NodeSubscription()
+ {
+ NodeId = req.NodeId,
+ TaskType = req.Type ?? default
+ });
+ return Ok(res);
+ }
+
+ ///
+ /// 获取任务类型
+ ///
+ ///
+ [HttpGet(Name = "TaskTypList")]
+ public IActionResult TaskType()
+ {
+ Type type = typeof(TaskTypeEnum);
+ return Ok(Enum.GetValues(type).Cast