From 1e4d7ac5f6b1e881345984278cfa9e9cb9c98295 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com>
Date: Wed, 5 Mar 2025 16:31:28 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=93=9D=E9=B2=B8?=
=?UTF-8?q?=E5=AD=97=E5=BA=93=20=E8=AE=A2=E9=98=85=E8=8A=82=E7=82=B9?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E8=B0=83=E6=95=B4=20Core=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=9E=9A=E4=B8=BE=E8=B7=AF=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Components/Pages/VideoTaskPage.razor | 17 +-
.../Components/Pages/VideoTaskPage.razor.cs | 2 +-
VideoAnalysis/Controllers/ApiController.cs | 37 +---
VideoAnalysis/Controllers/Dto/ApiDto.cs | 8 +-
VideoAnalysis/Controllers/LJZK_Controller.cs | 74 +++++++
VideoAnalysis/appsettings.json | 2 +-
.../AICore/FFMPGE/FFMPGEHandle.cs | 3 +-
.../AICore/GPT/ChatGPT/Chat_GPT.cs | 2 +-
.../AICore/GPT/DeepSeek/DeepSeek_GPT.cs | 2 +-
.../AICore/GPT/Dto/CallGPTRes.cs | 2 +-
VideoAnalysisCore/AICore/GPT/KIMI/KIMI_GPT.cs | 2 +-
.../AICore/SherpaOnnx/SenseVoice.cs | 3 +-
.../AICore/SherpaOnnx/Speaker.cs | 3 +-
.../AICore/Whisper/WhisperHandle.cs | 3 +-
VideoAnalysisCore/Common/AppCommon.cs | 9 +-
VideoAnalysisCore/Common/CoravelExpand.cs | 4 +-
VideoAnalysisCore/Common/DownloadFile.cs | 3 +-
VideoAnalysisCore/Common/RedisExpand.cs | 2 +-
VideoAnalysisCore/Enum/ScoreTypeEnum.cs | 13 --
VideoAnalysisCore/Job/NodeSubscriptionJob.cs | 68 ++++++
VideoAnalysisCore/Job/UnprocessedVideoJob.cs | 28 ---
.../Model/CourseGradingCriteria.cs | 2 +-
VideoAnalysisCore/Model/Dto/HotwordMode.cs | 2 +-
.../Model/Dto/SpeakerCaptionsDto.cs | 2 +-
VideoAnalysisCore/Model/Dto/VideoTaskDto.cs | 2 +-
.../{ => Model}/Enum/QuestionTypeEnum.cs | 2 +-
.../{ => Model}/Enum/RedisChannelEnum.cs | 2 +-
VideoAnalysisCore/Model/Enum/ScoreTypeEnum.cs | 13 ++
.../{ => Model}/Enum/TaskTypeEnum.cs | 2 +-
.../{ => Model}/Enum/TeacherAnswerTypeEnum.cs | 2 +-
.../{ => Model}/Enum/TimeBaseEnum.cs | 2 +-
.../{ => Model}/Interface/IDB.cs | 2 +-
VideoAnalysisCore/Model/NodeSubscription.cs | 55 +++++
VideoAnalysisCore/Model/VideoKonwPoint.cs | 2 +-
VideoAnalysisCore/Model/VideoTask.cs | 4 +-
.../Model/蓝鲸智库/Attachments.cs | 12 +-
.../Model/蓝鲸智库/FileContent.cs | 113 +++++-----
.../Model/蓝鲸智库/FileContentMaterial.cs | 75 +++----
.../Model/蓝鲸智库/FileDirectory.cs | 201 +++++++++---------
VideoAnalysisCore/Model/蓝鲸智库/Material.cs | 30 +--
40 files changed, 484 insertions(+), 328 deletions(-)
create mode 100644 VideoAnalysis/Controllers/LJZK_Controller.cs
delete mode 100644 VideoAnalysisCore/Enum/ScoreTypeEnum.cs
create mode 100644 VideoAnalysisCore/Job/NodeSubscriptionJob.cs
delete mode 100644 VideoAnalysisCore/Job/UnprocessedVideoJob.cs
rename VideoAnalysisCore/{ => Model}/Enum/QuestionTypeEnum.cs (96%)
rename VideoAnalysisCore/{ => Model}/Enum/RedisChannelEnum.cs (94%)
create mode 100644 VideoAnalysisCore/Model/Enum/ScoreTypeEnum.cs
rename VideoAnalysisCore/{ => Model}/Enum/TaskTypeEnum.cs (93%)
rename VideoAnalysisCore/{ => Model}/Enum/TeacherAnswerTypeEnum.cs (88%)
rename VideoAnalysisCore/{ => Model}/Enum/TimeBaseEnum.cs (93%)
rename VideoAnalysisCore/{ => Model}/Interface/IDB.cs (82%)
create mode 100644 VideoAnalysisCore/Model/NodeSubscription.cs
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