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() + .Select(s => new { Text = s.ToString(), Value = (int)s })); + } + + + + + + + } +} diff --git a/VideoAnalysis/appsettings.json b/VideoAnalysis/appsettings.json index 696ed04..d184168 100644 --- a/VideoAnalysis/appsettings.json +++ b/VideoAnalysis/appsettings.json @@ -43,7 +43,7 @@ "DB": { "ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=learn.videoanalysis;CharSet=utf8mb4;pooling=true;SslMode=None", "SqlType": "MySql", - "UpdateTable": false + "UpdateTable": true }, "OtherDBArr": [ { diff --git a/VideoAnalysisCore/AICore/FFMPGE/FFMPGEHandle.cs b/VideoAnalysisCore/AICore/FFMPGE/FFMPGEHandle.cs index b92a2ec..faf8b6a 100644 --- a/VideoAnalysisCore/AICore/FFMPGE/FFMPGEHandle.cs +++ b/VideoAnalysisCore/AICore/FFMPGE/FFMPGEHandle.cs @@ -8,6 +8,7 @@ using System.Xml.Linq; using System.Runtime.InteropServices; using SqlSugar.IOC; using VideoAnalysisCore.Model; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.FFMPGE { @@ -85,7 +86,7 @@ namespace VideoAnalysisCore.AICore.FFMPGE { Console.WriteLine("转换完成=>" + e.Output.Name); //加入下一队列 - RedisExpand.InsertChannel(Enum.RedisChannelEnum.ParsingCaptions, Task); + RedisExpand.InsertChannel(RedisChannelEnum.ParsingCaptions, Task); } } } diff --git a/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs b/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs index 2325f4e..5bae611 100644 --- a/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs +++ b/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs @@ -3,7 +3,6 @@ using System.Text.Json; using VideoAnalysisCore.Model; using System.Text; using System.ComponentModel.DataAnnotations; -using VideoAnalysisCore.Enum; using System.Reflection; using VideoAnalysisCore.Model.Dto; using VideoAnalysisCore.AICore.GPT.Dto; @@ -11,6 +10,7 @@ using VideoAnalysisCore.AICore.GPT; using System.Threading.Tasks; using VideoAnalysisCore.AICore.SherpaOnnx; using VideoAnalysisCore.Model.蓝鲸智库; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.GPT.ChatGPT { diff --git a/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs b/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs index a013a57..26c7806 100644 --- a/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs +++ b/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs @@ -3,7 +3,6 @@ using System.Text.Json; using VideoAnalysisCore.Model; using System.Text; using System.ComponentModel.DataAnnotations; -using VideoAnalysisCore.Enum; using System.Reflection; using VideoAnalysisCore.Model.Dto; using VideoAnalysisCore.AICore.GPT.Dto; @@ -11,6 +10,7 @@ using System.Threading.Tasks; using VideoAnalysisCore.AICore.GPT.ChatGPT; using VideoAnalysisCore.AICore.SherpaOnnx; using VideoAnalysisCore.Model.蓝鲸智库; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.GPT.DeepSeek { diff --git a/VideoAnalysisCore/AICore/GPT/Dto/CallGPTRes.cs b/VideoAnalysisCore/AICore/GPT/Dto/CallGPTRes.cs index ec29722..5693eea 100644 --- a/VideoAnalysisCore/AICore/GPT/Dto/CallGPTRes.cs +++ b/VideoAnalysisCore/AICore/GPT/Dto/CallGPTRes.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using VideoAnalysisCore.Enum; using VideoAnalysisCore.Model.Dto; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.GPT.Dto { diff --git a/VideoAnalysisCore/AICore/GPT/KIMI/KIMI_GPT.cs b/VideoAnalysisCore/AICore/GPT/KIMI/KIMI_GPT.cs index 9678c03..5576b54 100644 --- a/VideoAnalysisCore/AICore/GPT/KIMI/KIMI_GPT.cs +++ b/VideoAnalysisCore/AICore/GPT/KIMI/KIMI_GPT.cs @@ -8,7 +8,6 @@ using System.Text; using FFmpeg.NET.Services; using Microsoft.Extensions.Primitives; using System.ComponentModel.DataAnnotations; -using VideoAnalysisCore.Enum; using System.Reflection; using FreeRedis; using VideoAnalysisCore.Model.Dto; @@ -17,6 +16,7 @@ using SqlSugar.IOC; using VideoAnalysisCore.AICore.GPT.Dto; using VideoAnalysisCore.AICore.GPT; using VideoAnalysisCore.AICore.GPT.ChatGPT; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.GPT.KIMI { diff --git a/VideoAnalysisCore/AICore/SherpaOnnx/SenseVoice.cs b/VideoAnalysisCore/AICore/SherpaOnnx/SenseVoice.cs index fbdfb15..878c816 100644 --- a/VideoAnalysisCore/AICore/SherpaOnnx/SenseVoice.cs +++ b/VideoAnalysisCore/AICore/SherpaOnnx/SenseVoice.cs @@ -12,6 +12,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using VideoAnalysisCore.Common; using VideoAnalysisCore.Model; +using VideoAnalysisCore.Model.Enum; using static System.Runtime.InteropServices.JavaScript.JSType; namespace VideoAnalysisCore.AICore.SherpaOnnx @@ -267,7 +268,7 @@ namespace VideoAnalysisCore.AICore.SherpaOnnx .Where(it => it.Id == long.Parse(task)); await RedisExpand.Redis.HMSetAsync(RedisExpandKey.Task(task), "Captions", res); //RedisExpand.InsertChannel(Enum.RedisChannelEnum.ParsingSpeaker, task); - RedisExpand.InsertChannel(Enum.RedisChannelEnum.ChatModelAnalysis, task); + RedisExpand.InsertChannel(RedisChannelEnum.ChatModelAnalysis, task); } } diff --git a/VideoAnalysisCore/AICore/SherpaOnnx/Speaker.cs b/VideoAnalysisCore/AICore/SherpaOnnx/Speaker.cs index c434ee4..219eb7f 100644 --- a/VideoAnalysisCore/AICore/SherpaOnnx/Speaker.cs +++ b/VideoAnalysisCore/AICore/SherpaOnnx/Speaker.cs @@ -7,6 +7,7 @@ using SherpaOnnx; using SqlSugar.IOC; using VideoAnalysisCore.Model; using System.Text.Json; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.SherpaOnnx { @@ -81,7 +82,7 @@ namespace VideoAnalysisCore.AICore.SherpaOnnx .SetColumns(it => it.Speaker == speakerStr) .Where(it => it.Id == long.Parse(task)); //加入下一队列 - RedisExpand.InsertChannel(Enum.RedisChannelEnum.ChatModelAnalysis, task); + RedisExpand.InsertChannel(RedisChannelEnum.ChatModelAnalysis, task); } } diff --git a/VideoAnalysisCore/AICore/Whisper/WhisperHandle.cs b/VideoAnalysisCore/AICore/Whisper/WhisperHandle.cs index 8ab2f15..f244ec2 100644 --- a/VideoAnalysisCore/AICore/Whisper/WhisperHandle.cs +++ b/VideoAnalysisCore/AICore/Whisper/WhisperHandle.cs @@ -4,6 +4,7 @@ using System.Linq; using Whisper.net; using Whisper.net.Ggml; using Whisper.net.Wave; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.AICore.Whisper { @@ -45,7 +46,7 @@ namespace VideoAnalysisCore.AICore.Whisper res.Add(new WhisperResDto(segment)); } RedisExpand.Redis.HMSet(RedisExpandKey.Task(task), "Captions", res); - RedisExpand.InsertChannel(Enum.RedisChannelEnum.ParsingSpeaker, task); + RedisExpand.InsertChannel(RedisChannelEnum.ParsingSpeaker, task); } /// /// 检测语言的方法 diff --git a/VideoAnalysisCore/Common/AppCommon.cs b/VideoAnalysisCore/Common/AppCommon.cs index 46194d9..838aa06 100644 --- a/VideoAnalysisCore/Common/AppCommon.cs +++ b/VideoAnalysisCore/Common/AppCommon.cs @@ -15,10 +15,9 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using UserCenter.Model.Interface; using VideoAnalysisCore.AICore.SherpaOnnx; -using VideoAnalysisCore.Enum; -using VideoAnalysisCore.Interface; -using VideoAnalysisCore.Model; using VideoAnalysisCore.Model.Dto; +using VideoAnalysisCore.Model.Enum; +using VideoAnalysisCore.Model.Interface; namespace VideoAnalysisCore.Common { @@ -406,7 +405,9 @@ namespace VideoAnalysisCore.Common /// 数据库配置 /// public DBConfig DB { get; set; } = new DBConfig(); - + /// + /// 其他数据库配置 + /// public DBConfig[] OtherDBArr { get; set; } = Array.Empty(); } diff --git a/VideoAnalysisCore/Common/CoravelExpand.cs b/VideoAnalysisCore/Common/CoravelExpand.cs index b4a1438..720fdb7 100644 --- a/VideoAnalysisCore/Common/CoravelExpand.cs +++ b/VideoAnalysisCore/Common/CoravelExpand.cs @@ -17,14 +17,14 @@ namespace VideoAnalysisCore.Common { service.AddScheduler(); - service.AddTransient(); + service.AddTransient(); } public static void Run(IServiceProvider provider) { provider.UseScheduler(scheduler => { //每5分钟执行一次 未处理视频扫描 - scheduler.Schedule().EveryFiveMinutes(); + scheduler.Schedule().EveryFiveMinutes(); }); } } diff --git a/VideoAnalysisCore/Common/DownloadFile.cs b/VideoAnalysisCore/Common/DownloadFile.cs index a5ceb4b..2cd469a 100644 --- a/VideoAnalysisCore/Common/DownloadFile.cs +++ b/VideoAnalysisCore/Common/DownloadFile.cs @@ -8,6 +8,7 @@ using System.IO; using System.Net; using System.Threading.Tasks; using VideoAnalysisCore.Model; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.Common { @@ -153,7 +154,7 @@ namespace VideoAnalysisCore.Common else if (download.Status == DownloadStatus.Completed) { //加入下一队列 - RedisExpand.InsertChannel(Enum.RedisChannelEnum.SeparateAudio, task); + RedisExpand.InsertChannel(RedisChannelEnum.SeparateAudio, task); return; } diff --git a/VideoAnalysisCore/Common/RedisExpand.cs b/VideoAnalysisCore/Common/RedisExpand.cs index 6de3f7a..365d26b 100644 --- a/VideoAnalysisCore/Common/RedisExpand.cs +++ b/VideoAnalysisCore/Common/RedisExpand.cs @@ -17,9 +17,9 @@ using VideoAnalysisCore.AICore.GPT.Dto; //using VideoAnalysisCore.AICore.FFMPGE; using VideoAnalysisCore.AICore.SherpaOnnx; using VideoAnalysisCore.AICore.Whisper; -using VideoAnalysisCore.Enum; using VideoAnalysisCore.Model; using VideoAnalysisCore.Model.Dto; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.Common { diff --git a/VideoAnalysisCore/Enum/ScoreTypeEnum.cs b/VideoAnalysisCore/Enum/ScoreTypeEnum.cs deleted file mode 100644 index 5ed30ef..0000000 --- a/VideoAnalysisCore/Enum/ScoreTypeEnum.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace VideoAnalysisCore.Enum -{ - /// - /// 得分类型 - /// - public enum ScoreTypeEnum - { - 优=75, - 良=50, - 中=25, - 差=0, - } -} diff --git a/VideoAnalysisCore/Job/NodeSubscriptionJob.cs b/VideoAnalysisCore/Job/NodeSubscriptionJob.cs new file mode 100644 index 0000000..2a39c7f --- /dev/null +++ b/VideoAnalysisCore/Job/NodeSubscriptionJob.cs @@ -0,0 +1,68 @@ +using Coravel.Invocable; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VideoAnalysisCore.Common; +using VideoAnalysisCore.Model; +using VideoAnalysisCore.Model.蓝鲸智库; + +namespace VideoAnalysisCore.Job +{ + /// + /// [蓝鲸智库] 查找未处理的视频 + /// + public class NodeSubscriptionJob : IInvocable + { + private readonly Repository nodesubscriptionDB; + private readonly Repository attachmentsDB; + public NodeSubscriptionJob(Repository videoTaskDB, Repository nodesubscriptionDB) + { + this.attachmentsDB = videoTaskDB; + this.nodesubscriptionDB = nodesubscriptionDB; + } + public async Task Invoke() + { + Console.WriteLine($"{DateTime.Now} Invoke=>{this.GetType().FullName}"); + + var tasks = await nodesubscriptionDB.GetListAsync(s => s.Enable); + foreach (var item in tasks) + { + var fileNodeId = item.NodeId; + var data = attachmentsDB.Context.Ado + .SqlQuery($""" + SELECT + * + FROM + Attachments + WHERE + Id IN ( + SELECT + AttachmentsId + FROM + Material + WHERE + id IN ( + SELECT + MaterialId + FROM + FileContentMaterial + WHERE + FileContentId IN ( SELECT id FROM FileContent WHERE BagId IN ( SELECT Id FROM FileDirectory WHERE Id={fileNodeId} AND types = 1 AND DeleteState = 0 ) ) + AND DeleteState = 0 + AND ( MaterialName NOT LIKE '%PPT%' OR MaterialName NOT LIKE '%ppt%' ) + ) + ) + AND Type = '录播视频' + AND ( + NAME NOT LIKE '%PPT%' + OR NAME NOT LIKE '%ppt%' + ) + """); + + + } + } + } +} diff --git a/VideoAnalysisCore/Job/UnprocessedVideoJob.cs b/VideoAnalysisCore/Job/UnprocessedVideoJob.cs deleted file mode 100644 index 224835a..0000000 --- a/VideoAnalysisCore/Job/UnprocessedVideoJob.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Coravel.Invocable; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VideoAnalysisCore.Common; -using VideoAnalysisCore.Model; - -namespace VideoAnalysisCore.Job -{ - /// - /// 查找未处理的视频 - /// - public class UnprocessedVideoJob : IInvocable - { - private readonly Repository videoTaskDB; - public UnprocessedVideoJob(Repository videoTaskDB) - { - this.videoTaskDB = videoTaskDB; - } - public async Task Invoke() - { - - - } - } -} diff --git a/VideoAnalysisCore/Model/CourseGradingCriteria.cs b/VideoAnalysisCore/Model/CourseGradingCriteria.cs index 1cfd29d..ec8f8bb 100644 --- a/VideoAnalysisCore/Model/CourseGradingCriteria.cs +++ b/VideoAnalysisCore/Model/CourseGradingCriteria.cs @@ -6,7 +6,7 @@ using System.Net; using UserCenter.Model.Enum; using VideoAnalysisCore.AICore.SherpaOnnx; using VideoAnalysisCore.Enum; -using VideoAnalysisCore.Interface; +using VideoAnalysisCore.Model.Interface; using Whisper.net; namespace VideoAnalysisCore.Model diff --git a/VideoAnalysisCore/Model/Dto/HotwordMode.cs b/VideoAnalysisCore/Model/Dto/HotwordMode.cs index b842e37..d31e1c8 100644 --- a/VideoAnalysisCore/Model/Dto/HotwordMode.cs +++ b/VideoAnalysisCore/Model/Dto/HotwordMode.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace VideoAnalysisCore.Model +namespace VideoAnalysisCore.Model.Dto { public class HotwordMode { diff --git a/VideoAnalysisCore/Model/Dto/SpeakerCaptionsDto.cs b/VideoAnalysisCore/Model/Dto/SpeakerCaptionsDto.cs index c2c1f7f..fca152e 100644 --- a/VideoAnalysisCore/Model/Dto/SpeakerCaptionsDto.cs +++ b/VideoAnalysisCore/Model/Dto/SpeakerCaptionsDto.cs @@ -1,6 +1,6 @@ using AntDesign; using VideoAnalysisCore.AICore.GPT.Dto; -using VideoAnalysisCore.Enum; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.Model.Dto { diff --git a/VideoAnalysisCore/Model/Dto/VideoTaskDto.cs b/VideoAnalysisCore/Model/Dto/VideoTaskDto.cs index 574a58e..a80893d 100644 --- a/VideoAnalysisCore/Model/Dto/VideoTaskDto.cs +++ b/VideoAnalysisCore/Model/Dto/VideoTaskDto.cs @@ -6,9 +6,9 @@ using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; -using VideoAnalysisCore.Enum; using System.Text.Json; using UserCenter.Model.Enum; +using VideoAnalysisCore.Model.Enum; namespace VideoAnalysisCore.Model.Dto { diff --git a/VideoAnalysisCore/Enum/QuestionTypeEnum.cs b/VideoAnalysisCore/Model/Enum/QuestionTypeEnum.cs similarity index 96% rename from VideoAnalysisCore/Enum/QuestionTypeEnum.cs rename to VideoAnalysisCore/Model/Enum/QuestionTypeEnum.cs index 61c311d..61f6307 100644 --- a/VideoAnalysisCore/Enum/QuestionTypeEnum.cs +++ b/VideoAnalysisCore/Model/Enum/QuestionTypeEnum.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace VideoAnalysisCore.Enum +namespace VideoAnalysisCore.Model.Enum { public enum QuestionTypeEnum { diff --git a/VideoAnalysisCore/Enum/RedisChannelEnum.cs b/VideoAnalysisCore/Model/Enum/RedisChannelEnum.cs similarity index 94% rename from VideoAnalysisCore/Enum/RedisChannelEnum.cs rename to VideoAnalysisCore/Model/Enum/RedisChannelEnum.cs index 281d95d..716321c 100644 --- a/VideoAnalysisCore/Enum/RedisChannelEnum.cs +++ b/VideoAnalysisCore/Model/Enum/RedisChannelEnum.cs @@ -1,4 +1,4 @@ -namespace VideoAnalysisCore.Enum +namespace VideoAnalysisCore.Model.Enum { /// /// redis 频道 diff --git a/VideoAnalysisCore/Model/Enum/ScoreTypeEnum.cs b/VideoAnalysisCore/Model/Enum/ScoreTypeEnum.cs new file mode 100644 index 0000000..cbbc98e --- /dev/null +++ b/VideoAnalysisCore/Model/Enum/ScoreTypeEnum.cs @@ -0,0 +1,13 @@ +namespace VideoAnalysisCore.Model.Enum +{ + /// + /// 得分类型 + /// + public enum ScoreTypeEnum + { + 优 = 75, + 良 = 50, + 中 = 25, + 差 = 0, + } +} diff --git a/VideoAnalysisCore/Enum/TaskTypeEnum.cs b/VideoAnalysisCore/Model/Enum/TaskTypeEnum.cs similarity index 93% rename from VideoAnalysisCore/Enum/TaskTypeEnum.cs rename to VideoAnalysisCore/Model/Enum/TaskTypeEnum.cs index 69d3389..b87e627 100644 --- a/VideoAnalysisCore/Enum/TaskTypeEnum.cs +++ b/VideoAnalysisCore/Model/Enum/TaskTypeEnum.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace VideoAnalysisCore.Enum +namespace VideoAnalysisCore.Model.Enum { public enum TaskTypeEnum { diff --git a/VideoAnalysisCore/Enum/TeacherAnswerTypeEnum.cs b/VideoAnalysisCore/Model/Enum/TeacherAnswerTypeEnum.cs similarity index 88% rename from VideoAnalysisCore/Enum/TeacherAnswerTypeEnum.cs rename to VideoAnalysisCore/Model/Enum/TeacherAnswerTypeEnum.cs index 4c2e5fd..5e6605b 100644 --- a/VideoAnalysisCore/Enum/TeacherAnswerTypeEnum.cs +++ b/VideoAnalysisCore/Model/Enum/TeacherAnswerTypeEnum.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace VideoAnalysisCore.Enum +namespace VideoAnalysisCore.Model.Enum { public enum TeacherAnswerTypeEnum { diff --git a/VideoAnalysisCore/Enum/TimeBaseEnum.cs b/VideoAnalysisCore/Model/Enum/TimeBaseEnum.cs similarity index 93% rename from VideoAnalysisCore/Enum/TimeBaseEnum.cs rename to VideoAnalysisCore/Model/Enum/TimeBaseEnum.cs index 1bc39ac..f31374f 100644 --- a/VideoAnalysisCore/Enum/TimeBaseEnum.cs +++ b/VideoAnalysisCore/Model/Enum/TimeBaseEnum.cs @@ -1,4 +1,4 @@ -namespace VideoAnalysisCore.Enum +namespace VideoAnalysisCore.Model.Enum { /// /// 时间线类型 diff --git a/VideoAnalysisCore/Interface/IDB.cs b/VideoAnalysisCore/Model/Interface/IDB.cs similarity index 82% rename from VideoAnalysisCore/Interface/IDB.cs rename to VideoAnalysisCore/Model/Interface/IDB.cs index 9bb9511..1a825b3 100644 --- a/VideoAnalysisCore/Interface/IDB.cs +++ b/VideoAnalysisCore/Model/Interface/IDB.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace VideoAnalysisCore.Interface +namespace VideoAnalysisCore.Model.Interface { /// /// 表属于IDB diff --git a/VideoAnalysisCore/Model/NodeSubscription.cs b/VideoAnalysisCore/Model/NodeSubscription.cs new file mode 100644 index 0000000..9be18cb --- /dev/null +++ b/VideoAnalysisCore/Model/NodeSubscription.cs @@ -0,0 +1,55 @@ +using AntDesign; +using SqlSugar; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Net; +using UserCenter.Model.Enum; +using VideoAnalysisCore.AICore.SherpaOnnx; +using VideoAnalysisCore.Model.Enum; +using VideoAnalysisCore.Model.Interface; +using Whisper.net; + +namespace VideoAnalysisCore.Model +{ + /// + /// [蓝鲸智库]文件节点订阅 + /// + [SugarTable("nodesubscription")] + public class NodeSubscription: IDB + { + /// + /// Id + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + [DisplayName("编号")] + public long Id { get; set; } + /// + /// 文件节点Id + /// + [DisplayName("文件节点Id"), Required] + public long NodeId { get; set; } + + /// + /// 绑定学科 + /// + [DisplayName("绑定学科")] + public TaskTypeEnum TaskType { get; set; } + /// + /// 是否启用 + /// + [DisplayName("是否启用")] + public bool Enable { get; set; } = true; + /// + /// 最后执行的id值 + /// + [DisplayName("最后执行的id值")] + public long LastId { get; set; } + /// + /// 创建时间 + /// + [DisplayName("创建时间")] + public DateTime CreateTime { get; set; } =DateTime.Now; + + } +} diff --git a/VideoAnalysisCore/Model/VideoKonwPoint.cs b/VideoAnalysisCore/Model/VideoKonwPoint.cs index 3d5d1e7..18d4a87 100644 --- a/VideoAnalysisCore/Model/VideoKonwPoint.cs +++ b/VideoAnalysisCore/Model/VideoKonwPoint.cs @@ -6,7 +6,7 @@ using UserCenter.Model.Enum; using VideoAnalysisCore.AICore.GPT.Dto; using VideoAnalysisCore.AICore.SherpaOnnx; using VideoAnalysisCore.Enum; -using VideoAnalysisCore.Interface; +using VideoAnalysisCore.Model.Interface; using Whisper.net; namespace VideoAnalysisCore.Model diff --git a/VideoAnalysisCore/Model/VideoTask.cs b/VideoAnalysisCore/Model/VideoTask.cs index 22a5a7e..3fc49e6 100644 --- a/VideoAnalysisCore/Model/VideoTask.cs +++ b/VideoAnalysisCore/Model/VideoTask.cs @@ -5,8 +5,8 @@ using System.Text.Json; using UserCenter.Model.Enum; using VideoAnalysisCore.AICore.GPT.Dto; using VideoAnalysisCore.AICore.SherpaOnnx; -using VideoAnalysisCore.Enum; -using VideoAnalysisCore.Interface; +using VideoAnalysisCore.Model.Enum; +using VideoAnalysisCore.Model.Interface; using Whisper.net; namespace VideoAnalysisCore.Model diff --git a/VideoAnalysisCore/Model/蓝鲸智库/Attachments.cs b/VideoAnalysisCore/Model/蓝鲸智库/Attachments.cs index 66296fa..eecf394 100644 --- a/VideoAnalysisCore/Model/蓝鲸智库/Attachments.cs +++ b/VideoAnalysisCore/Model/蓝鲸智库/Attachments.cs @@ -4,7 +4,7 @@ using System.Text; using SqlSugar; using VideoAnalysisCore.Interface; -namespace App.Model +namespace VideoAnalysisCore.Model.蓝鲸智库 { /// ///文件附件 @@ -16,10 +16,10 @@ namespace App.Model public Attachments() { - this.SchoolId = Convert.ToInt64("0"); - this.Sort = Convert.ToInt32("0"); - this.CreateTime = DateTime.Now; - this.DeleteState = false; + SchoolId = Convert.ToInt64("0"); + Sort = Convert.ToInt32("0"); + CreateTime = DateTime.Now; + DeleteState = false; } /// @@ -175,7 +175,7 @@ namespace App.Model [SugarColumn(ColumnDescription = "新增用户角色id", IsNullable = true)] public long AdminRoleId { get; set; } - + } diff --git a/VideoAnalysisCore/Model/蓝鲸智库/FileContent.cs b/VideoAnalysisCore/Model/蓝鲸智库/FileContent.cs index eb3738a..25af937 100644 --- a/VideoAnalysisCore/Model/蓝鲸智库/FileContent.cs +++ b/VideoAnalysisCore/Model/蓝鲸智库/FileContent.cs @@ -4,25 +4,26 @@ using System.Text; using SqlSugar; using VideoAnalysisCore.Interface; -namespace App.Model +namespace VideoAnalysisCore.Model.蓝鲸智库 { /// /// 文件内容表 /// [SugarTable("FileContent")] [Tenant("1002")] - public partial class FileContent + public partial class FileContent { - public FileContent(){ + public FileContent() + { - this.Sort =Convert.ToInt32("0"); - this.CreateTime =DateTime.Now; - this.DeleteState =false; + Sort = Convert.ToInt32("0"); + CreateTime = DateTime.Now; + DeleteState = false; - } - - [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] - public long Id {get;set;} + } + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } /// /// Desc:内容名称 @@ -30,7 +31,7 @@ namespace App.Model /// Nullable:False /// [SugarColumn(ColumnDescription = "内容名称", ColumnDataType = "nvarchar(500)", IsNullable = false)] - public string FileName {get;set;} + public string FileName { get; set; } /// /// Desc: @@ -38,23 +39,23 @@ namespace App.Model /// Nullable:True /// [SugarColumn(ColumnDescription = "学校id", IsNullable = true)] - public long? SchoolId {get;set;} + public long? SchoolId { get; set; } - /// - /// Desc: - /// Default: - /// Nullable:True - /// + /// + /// Desc: + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "学校名称", ColumnDataType = "nvarchar(100)", IsNullable = true)] - public string SchoolName {get;set;} + public string SchoolName { get; set; } - /// - /// Desc:年级 - /// Default: - /// Nullable:True - /// + /// + /// Desc:年级 + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "年级", ColumnDataType = "nvarchar(30)", IsNullable = true)] - public string GradeName {get;set;} + public string GradeName { get; set; } /// /// Desc:科目 @@ -63,44 +64,44 @@ namespace App.Model /// [SugarColumn(ColumnDescription = "科目", IsNullable = true)] - public int? SubjectId {get;set;} + public int? SubjectId { get; set; } - /// - /// Desc: - /// Default: - /// Nullable:True - /// + /// + /// Desc: + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "科目名称", ColumnDataType = "nvarchar(50)", IsNullable = true)] - public string SubjectName {get;set;} + public string SubjectName { get; set; } - /// - /// Desc:文件系统目录id - /// Default: - /// Nullable:False - /// + /// + /// Desc:文件系统目录id + /// Default: + /// Nullable:False + /// [SugarColumn(ColumnDescription = "件系统目录id", IsNullable = false)] - public long FileDirectoryId {get;set;} + public long FileDirectoryId { get; set; } - /// - /// Desc: - /// Default:0 - /// Nullable:False - /// + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// [SugarColumn(ColumnDescription = "排序", IsNullable = false, DefaultValue = "0")] - public int Sort {get;set;} + public int Sort { get; set; } - - public DateTime CreateTime {get;set;} - - public bool DeleteState {get;set;} - /// - /// Desc:文件包Id - /// Default: - /// Nullable:False - /// + public DateTime CreateTime { get; set; } + + public bool DeleteState { get; set; } + + /// + /// Desc:文件包Id + /// Default: + /// Nullable:False + /// [SugarColumn(ColumnDescription = "文件包id", IsNullable = false)] - public long BagId {get;set;} + public long BagId { get; set; } /// /// Desc:作者 @@ -108,7 +109,7 @@ namespace App.Model /// Nullable:True /// [SugarColumn(ColumnDescription = "作者", ColumnDataType = "nvarchar(200)", IsNullable = true)] - public string Author {get;set;} + public string Author { get; set; } /// /// 是否可以下载 @@ -117,12 +118,12 @@ namespace App.Model /// /// 管理员id /// - [SugarColumn(ColumnDescription = "管理员id", IsNullable = true)] + [SugarColumn(ColumnDescription = "管理员id", IsNullable = true)] public long? AdminId { get; set; } /// /// 管理员角色id /// - [SugarColumn(ColumnDescription = "管理员角色id", IsNullable = true)] + [SugarColumn(ColumnDescription = "管理员角色id", IsNullable = true)] public long? AdminRoleId { get; set; } } } diff --git a/VideoAnalysisCore/Model/蓝鲸智库/FileContentMaterial.cs b/VideoAnalysisCore/Model/蓝鲸智库/FileContentMaterial.cs index a79eb62..8c4613c 100644 --- a/VideoAnalysisCore/Model/蓝鲸智库/FileContentMaterial.cs +++ b/VideoAnalysisCore/Model/蓝鲸智库/FileContentMaterial.cs @@ -4,56 +4,57 @@ using System.Text; using SqlSugar; using VideoAnalysisCore.Interface; -namespace App.Model +namespace VideoAnalysisCore.Model.蓝鲸智库 { /// /// /// [SugarTable("FileContentMaterial")] [Tenant("1002")] - public partial class FileContentMaterial + public partial class FileContentMaterial { - public FileContentMaterial(){ + public FileContentMaterial() + { - this.CreateTime =DateTime.Now; - this.DeleteState =false; + CreateTime = DateTime.Now; + DeleteState = false; - } - /// - /// Desc:文件系统内容 - /// Default: - /// Nullable:False - /// - [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] - public long Id {get;set;} + } + /// + /// Desc:文件系统内容 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } - /// - /// Desc:文件系统内容 - /// Default: - /// Nullable:False - /// - public long FileContentId {get;set;} + /// + /// Desc:文件系统内容 + /// Default: + /// Nullable:False + /// + public long FileContentId { get; set; } - /// - /// Desc:素材id - /// Default: - /// Nullable:False - /// - public long MaterialId {get;set;} + /// + /// Desc:素材id + /// Default: + /// Nullable:False + /// + public long MaterialId { get; set; } - /// - /// Desc: - /// Default:DateTime.Now - /// Nullable:False - /// - public DateTime CreateTime {get;set;} + /// + /// Desc: + /// Default:DateTime.Now + /// Nullable:False + /// + public DateTime CreateTime { get; set; } - /// - /// Desc: - /// Default:0 - /// Nullable:False - /// - public bool DeleteState {get;set;} + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public bool DeleteState { get; set; } public int Sort { get; set; } diff --git a/VideoAnalysisCore/Model/蓝鲸智库/FileDirectory.cs b/VideoAnalysisCore/Model/蓝鲸智库/FileDirectory.cs index e0e3173..82f9eb2 100644 --- a/VideoAnalysisCore/Model/蓝鲸智库/FileDirectory.cs +++ b/VideoAnalysisCore/Model/蓝鲸智库/FileDirectory.cs @@ -4,31 +4,32 @@ using System.Text; using SqlSugar; using VideoAnalysisCore.Interface; -namespace App.Model +namespace VideoAnalysisCore.Model.蓝鲸智库 { /// /// 文件目录表 /// [SugarTable("FileDirectory")] [Tenant("1002")] - public partial class FileDirectory + public partial class FileDirectory { - public FileDirectory(){ + public FileDirectory() + { - this.State =Convert.ToInt32("1"); - this.IsCheckedSelect =true; - this.IsLastNode =false; - this.ParentId =Convert.ToInt64("0"); - this.CreateTime =DateTime.Now; - this.DeleteState =false; - this.AliasName =Convert.ToString(""); - this.IsPublic =false; - this.Types =Convert.ToInt32("-1"); - this.Code =Convert.ToString(""); + State = Convert.ToInt32("1"); + IsCheckedSelect = true; + IsLastNode = false; + ParentId = Convert.ToInt64("0"); + CreateTime = DateTime.Now; + DeleteState = false; + AliasName = Convert.ToString(""); + IsPublic = false; + Types = Convert.ToInt32("-1"); + Code = Convert.ToString(""); - } - [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] - public long Id {get;set;} + } + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } /// /// Desc:名称 @@ -36,116 +37,116 @@ namespace App.Model /// Nullable:False /// [SugarColumn(ColumnDescription = "名称", ColumnDataType = "nvarchar(50)", IsNullable = false)] - public string Name {get;set;} + public string Name { get; set; } - /// - /// Desc:排序 - /// Default: - /// Nullable:False - /// + /// + /// Desc:排序 + /// Default: + /// Nullable:False + /// [SugarColumn(ColumnDescription = "排序", IsNullable = false)] - public int Sort {get;set;} + public int Sort { get; set; } - /// - /// Desc:结构状态 1=显示 - /// Default:1 - /// Nullable:False - /// - [SugarColumn(ColumnDescription = "结构状态 1=显示", IsNullable = false,DefaultValue ="1")] - public int State {get;set;} + /// + /// Desc:结构状态 1=显示 + /// Default:1 + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "结构状态 1=显示", IsNullable = false, DefaultValue = "1")] + public int State { get; set; } - /// - /// Desc:是否自动授权 - /// Default:1 - /// Nullable:False - /// + /// + /// Desc:是否自动授权 + /// Default:1 + /// Nullable:False + /// [SugarColumn(ColumnDescription = "是否自动授权", IsNullable = false, DefaultValue = "1")] - public bool IsCheckedSelect {get;set;} + public bool IsCheckedSelect { get; set; } - /// - /// Desc:是否最后一级节点 - /// Default:0 - /// Nullable:False - /// + /// + /// Desc:是否最后一级节点 + /// Default:0 + /// Nullable:False + /// [SugarColumn(ColumnDescription = "是否最后一级节点", IsNullable = false, DefaultValue = "0")] - public bool IsLastNode {get;set;} + public bool IsLastNode { get; set; } - /// - /// Desc:上级id - /// Default:0 - /// Nullable:False - /// + /// + /// Desc:上级id + /// Default:0 + /// Nullable:False + /// [SugarColumn(ColumnDescription = "上级id", IsNullable = false, DefaultValue = "0")] - public long ParentId {get;set;} + public long ParentId { get; set; } - - public DateTime CreateTime {get;set;} - - public bool DeleteState {get;set;} - /// - /// Desc:别名 - /// Default: - /// Nullable:False - /// + public DateTime CreateTime { get; set; } + + public bool DeleteState { get; set; } + + /// + /// Desc:别名 + /// Default: + /// Nullable:False + /// [SugarColumn(ColumnDescription = "别名", ColumnDataType = "nvarchar(50)", IsNullable = false)] - public string AliasName {get;set;} + public string AliasName { get; set; } - /// - /// Desc:是否公开 - /// Default:0 - /// Nullable:True - /// + /// + /// Desc:是否公开 + /// Default:0 + /// Nullable:True + /// [SugarColumn(ColumnDescription = "是否公开", IsNullable = true, DefaultValue = "0")] - public bool? IsPublic {get;set;} + public bool? IsPublic { get; set; } - /// - /// Desc:其他=-1,目录=0,课程=1,章=2,节=3 - /// Default:-1 - /// Nullable:True - /// + /// + /// Desc:其他=-1,目录=0,课程=1,章=2,节=3 + /// Default:-1 + /// Nullable:True + /// [SugarColumn(ColumnDescription = "其他=-1,目录=0,课程=1,章=2,节=3", IsNullable = true, DefaultValue = "-1")] - public int? Types {get;set;} + public int? Types { get; set; } - /// - /// Desc: - /// Default: - /// Nullable:True - /// + /// + /// Desc: + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)] - public DateTime? UpdateTime {get;set;} + public DateTime? UpdateTime { get; set; } - /// - /// Desc:课程id(来源courseinfo) - /// Default: - /// Nullable:True - /// + /// + /// Desc:课程id(来源courseinfo) + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "课程id(来源courseinfo)", IsNullable = true)] - public long? CourseId {get;set;} + public long? CourseId { get; set; } - /// - /// Desc:教材版本id(来源 textboox_versions) - /// Default: - /// Nullable:True - /// + /// + /// Desc:教材版本id(来源 textboox_versions) + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "教材版本id(来源 textboox_versions)", IsNullable = true)] - public long? VersionsId {get;set;} + public long? VersionsId { get; set; } - /// - /// Desc: - /// Default: - /// Nullable:True - /// + /// + /// Desc: + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "", ColumnDataType = "nvarchar(50)", IsNullable = true)] - public string Code {get;set;} + public string Code { get; set; } - /// - /// Desc:根节点id - /// Default: - /// Nullable:True - /// + /// + /// Desc:根节点id + /// Default: + /// Nullable:True + /// [SugarColumn(ColumnDescription = "根节点id", IsNullable = true)] - public long? RootId {get;set;} + public long? RootId { get; set; } /// /// 管理员id /// diff --git a/VideoAnalysisCore/Model/蓝鲸智库/Material.cs b/VideoAnalysisCore/Model/蓝鲸智库/Material.cs index 49cd3e8..8b0e3c8 100644 --- a/VideoAnalysisCore/Model/蓝鲸智库/Material.cs +++ b/VideoAnalysisCore/Model/蓝鲸智库/Material.cs @@ -4,24 +4,24 @@ using System.Text; using SqlSugar; using VideoAnalysisCore.Interface; -namespace App.Model +namespace VideoAnalysisCore.Model.蓝鲸智库 { /// ///素材表 /// [SugarTable("Material")] [Tenant("1002")] - public partial class Material + public partial class Material { public Material() { - this.TagId = Convert.ToInt64("0"); - this.CreateTime = DateTime.Now; - this.DeleteState = false; - this.DownState = false; + TagId = Convert.ToInt64("0"); + CreateTime = DateTime.Now; + DeleteState = false; + DownState = false; } - + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public long Id { get; set; } @@ -46,7 +46,7 @@ namespace App.Model /// Default:0 /// Nullable:False /// - [SugarColumn(ColumnDescription = "素标签Id", IsNullable = false,DefaultValue ="0")] + [SugarColumn(ColumnDescription = "素标签Id", IsNullable = false, DefaultValue = "0")] public long TagId { get; set; } /// @@ -62,7 +62,7 @@ namespace App.Model /// Default: /// Nullable:False /// - [SugarColumn(ColumnDescription = "附件id",IsNullable = false)] + [SugarColumn(ColumnDescription = "附件id", IsNullable = false)] public long AttachmentsId { get; set; } /// @@ -72,9 +72,9 @@ namespace App.Model /// [SugarColumn(ColumnDescription = "内容", ColumnDataType = "nvarchar(max)", IsNullable = true)] public string Desc { get; set; } - + public DateTime CreateTime { get; set; } - + public bool DeleteState { get; set; } /// @@ -88,10 +88,10 @@ namespace App.Model /// Default: /// Nullable:False /// - [SugarColumn(ColumnDescription = "新增用户名称",ColumnDataType = "nvarchar(50)")] + [SugarColumn(ColumnDescription = "新增用户名称", ColumnDataType = "nvarchar(50)")] public string CreateUserName { get; set; } - [SugarColumn(ColumnDescription = "学校id",IsNullable =true)] + [SugarColumn(ColumnDescription = "学校id", IsNullable = true)] public long SchoolId { get; set; } [SugarColumn(ColumnDescription = "学校名称", ColumnDataType = "nvarchar(50)", IsNullable = true)] @@ -99,12 +99,12 @@ namespace App.Model /// /// 是否可以下载 /// - [SugarColumn(ColumnDescription = "是否可以下载", DefaultValue ="0")] + [SugarColumn(ColumnDescription = "是否可以下载", DefaultValue = "0")] public bool DownState { get; set; } /// /// 新增用户角色id /// - [SugarColumn(ColumnDescription = "新增用户角色id",IsNullable =true)] + [SugarColumn(ColumnDescription = "新增用户角色id", IsNullable = true)] public long AdminRoleId { get; set; } } }