diff --git a/VideoAnalysis/Controllers/ApiController.cs b/VideoAnalysis/Controllers/ApiController.cs index d8846c2..1b25a3e 100644 --- a/VideoAnalysis/Controllers/ApiController.cs +++ b/VideoAnalysis/Controllers/ApiController.cs @@ -98,34 +98,6 @@ namespace Learn.VideoAnalysis.Controllers return Ok(resStr); } - [NonAction] - private static List MergeTimeBases(IEnumerable timeBases) - { - if (timeBases == null || timeBases.Count() == 0) - { - return new List(); - } - var mergedList = new List(); - // 初始化合并段 - var current = timeBases.First(); - current.Content = string.Empty; - foreach (var next in timeBases) - { - // 如果类型相同,则扩展时间段 - if (current.TimeBaseType == next.TimeBaseType) - current.End = Math.Max(current.End, next.End); - else - { - // 类型不同,将当前时间段加入结果列表,并开始新时间段 - mergedList.Add(current); - current = next; - current.Content = string.Empty; - } - } - // 添加最后的时间段 - mergedList.Add(current); - return mergedList; - } /// /// 重新开始执行GPT分析taskId/tagId二选一 @@ -154,79 +126,6 @@ namespace Learn.VideoAnalysis.Controllers return Ok(); } - /// - /// 获取视频知识点片段taskId/tagId二选一 - /// - /// - /// 自定义id - /// - [HttpGet(Name = "TaskKnowInfo")] - public async Task TaskKnowInfo(long taskId, string? tagId) - { - if (taskId == 0 && string.IsNullOrEmpty(tagId)) - return BadRequest(); - var task = await videoTaskDB.AsQueryable() - .WhereIF(taskId != 0, s => s.Id == taskId) - .WhereIF(!string.IsNullOrEmpty(tagId), s => s.TagId == tagId) - .FirstAsync(); - if(task is null) - return BadRequest("无效任务"); - - var konwArr = await videoKonwDB.AsQueryable() - .Where(s=>s.VideoTaskId == task.Id) - .ToArrayAsync(); - if (konwArr is null || konwArr.Length ==0) - return BadRequest("无效任务"); - return Ok(new TaskKnowRes() - { - TagId = task.TagId, - Status = task.LastEnum, - VideoTaskId = task.Id, - KnowBlockArr = konwArr - .GroupBy(s=>s.StartTime) - .Select(s=>new TaskKnowBlock() - { - Id = s.First().Id, - Content = s.First().Content, - StartTime = s.First().StartTime, - EndTime = s.First().EndTime, - Theme =s.First().Theme, - Know=s.Select(x=>new TaskKnowInfo() - { - Id=x.Id, - KnowPoint=x.KnowPoint, - KnowPointId = x.KnowPointId - }).ToArray() - }).ToArray() - }); - } - /// - /// 获取视频信息taskId/tagId二选一 - /// - /// - /// 自定义id - /// - [HttpGet(Name = "TaskInfo")] - public async Task TaskInfo(long taskId,string? tagId) - { - if(taskId == 0 && string.IsNullOrEmpty(tagId)) - return BadRequest(); - var task = await videoTaskDB.AsQueryable() - .WhereIF(taskId!=0, s => s.Id == taskId) - .WhereIF(!string.IsNullOrEmpty(tagId), s => s.TagId == tagId) - .FirstAsync(); - if (task is null) - return BadRequest(); - var taskData = task.ChatAnalysis.Adapt(); - if (taskData is null) - return BadRequest(); - taskData.Status = task.LastEnum; - if (task.LastEnum != RedisChannelEnum.EndTask) - return BadRequest(taskData); - if (taskData != null && taskData.TimeBase != null) - taskData.TimeBase = MergeTimeBases(taskData.TimeBase); - return Ok(taskData); - } /// /// 插入队列 @@ -241,6 +140,7 @@ namespace Learn.VideoAnalysis.Controllers , msg); return Ok(); } + /// /// 视频处理 /// @@ -274,5 +174,140 @@ namespace Learn.VideoAnalysis.Controllers RedisExpand.Redis.LPush(RedisExpandKey.ChannelKey, 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(); + } + + + + + + ///// + ///// 获取视频知识点片段taskId/tagId二选一 + ///// + ///// + ///// 自定义id + ///// + //[HttpGet(Name = "TaskKnowInfo")] + //public async Task TaskKnowInfo(long taskId, string? tagId) + //{ + // if (taskId == 0 && string.IsNullOrEmpty(tagId)) + // return BadRequest(); + // var task = await videoTaskDB.AsQueryable() + // .WhereIF(taskId != 0, s => s.Id == taskId) + // .WhereIF(!string.IsNullOrEmpty(tagId), s => s.TagId == tagId) + // .FirstAsync(); + // if (task is null) + // return BadRequest("无效任务"); + + // var konwArr = await videoKonwDB.AsQueryable() + // .Where(s => s.VideoTaskId == task.Id) + // .ToArrayAsync(); + // if (konwArr is null || konwArr.Length == 0) + // return BadRequest("无效任务"); + // return Ok(new TaskKnowRes() + // { + // TagId = task.TagId, + // Status = task.LastEnum, + // VideoTaskId = task.Id, + // KnowBlockArr = konwArr + // .GroupBy(s => s.StartTime) + // .Select(s => new TaskKnowBlock() + // { + // Id = s.First().Id, + // Content = s.First().Content, + // StartTime = s.First().StartTime, + // EndTime = s.First().EndTime, + // Theme = s.First().Theme, + // Know = s.Select(x => new TaskKnowInfo() + // { + // Id = x.Id, + // KnowPoint = x.KnowPoint, + // KnowPointId = x.KnowPointId + // }).ToArray() + // }).ToArray() + // }); + //} + ///// + ///// 获取视频信息taskId/tagId二选一 + ///// + ///// + ///// 自定义id + ///// + //[HttpGet(Name = "TaskInfo")] + //public async Task TaskInfo(long taskId, string? tagId) + //{ + // if (taskId == 0 && string.IsNullOrEmpty(tagId)) + // return BadRequest(); + // var task = await videoTaskDB.AsQueryable() + // .WhereIF(taskId != 0, s => s.Id == taskId) + // .WhereIF(!string.IsNullOrEmpty(tagId), s => s.TagId == tagId) + // .FirstAsync(); + // if (task is null) + // return BadRequest(); + // var taskData = task.ChatAnalysis.Adapt(); + // if (taskData is null) + // return BadRequest(); + // taskData.Status = task.LastEnum; + // if (task.LastEnum != RedisChannelEnum.EndTask) + // return BadRequest(taskData); + // if (taskData != null && taskData.TimeBase != null) + // taskData.TimeBase = MergeTimeBases(taskData.TimeBase); + // return Ok(taskData); + //} + + + //[NonAction] + //private static List MergeTimeBases(IEnumerable timeBases) + //{ + // if (timeBases == null || timeBases.Count() == 0) + // { + // return new List(); + // } + // var mergedList = new List(); + // // 初始化合并段 + // var current = timeBases.First(); + // current.Content = string.Empty; + // foreach (var next in timeBases) + // { + // // 如果类型相同,则扩展时间段 + // if (current.TimeBaseType == next.TimeBaseType) + // current.End = Math.Max(current.End, next.End); + // else + // { + // // 类型不同,将当前时间段加入结果列表,并开始新时间段 + // mergedList.Add(current); + // current = next; + // current.Content = string.Empty; + // } + // } + // // 添加最后的时间段 + // mergedList.Add(current); + // return mergedList; + //} + + + + + + } } diff --git a/VideoAnalysis/Controllers/Dto/ApiDto.cs b/VideoAnalysis/Controllers/Dto/ApiDto.cs index 5ad1098..7784f6f 100644 --- a/VideoAnalysis/Controllers/Dto/ApiDto.cs +++ b/VideoAnalysis/Controllers/Dto/ApiDto.cs @@ -7,6 +7,26 @@ using VideoAnalysisCore.Enum; namespace Learn.VideoAnalysis.Controllers.Dto { + /// + /// 瑙嗛澶勭悊 璇锋眰 + /// + public class NodeMonitoringReq + { + /// + /// 濯掍綋璺緞 + /// + [Required(ErrorMessage = "鏂囦欢鑺傜偣ID鏄繀濉」")] + public string NodeId { get; set; } = string.Empty; + /// + /// 浠诲姟绫诲瀷 + /// + public TaskTypeEnum? Type { get; set; } + /// + /// 鑷畾涔夊 浠诲姟瀹屾垚鍚庨檮甯﹂氱煡 + /// + public string Tag { get; set; } = string.Empty; + + } /// /// 瑙嗛澶勭悊 璇锋眰 /// diff --git a/VideoAnalysis/Program.cs b/VideoAnalysis/Program.cs index 75f8d39..a51080b 100644 --- a/VideoAnalysis/Program.cs +++ b/VideoAnalysis/Program.cs @@ -59,7 +59,9 @@ namespace Learn.VideoAnalysis builder.Services.InitSqlSugar(); RedisExpand.Init(); Speaker.Init(); + CoravelExpand.Init(builder.Services); //SenseVoice.Init(); + //异常过滤器 builder.Services.AddControllersWithViews(options => { options.Filters.Add(typeof(ExceptionFilter)); @@ -106,32 +108,26 @@ namespace Learn.VideoAnalysis app.UseSwaggerUI(); app.UseExceptionHandler("/Error"); } - //else - //{ - // app.UseExceptionHandler("/Login"); - //} - + //添加wwwroot 静态目录 app.UseStaticFiles(); - + //添加 自定义 静态目录 app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(AppCommon.TaskCachedFile), RequestPath = "/video", - //OnPrepareResponse = ctx => //缓存 - //{ - // ctx.Context.Response.Headers[Microsoft.Net.Http.Headers.HeaderNames.CacheControl] = "public,max - age = 31536000"; - //} }); app.UseAntiforgery(); - app.MapRazorComponents() + app.MapRazorComponents() .AddInteractiveServerRenderMode(); //.AddInteractiveWebAssemblyRenderMode() //.AddAdditionalAssemblies(typeof(VideoAnalysisRazor._Imports).Assembly); app.MapControllers(); + //自定义 应用 SqlSugarExpand.InitDB(); + CoravelExpand.Run(app.Services); app.Run(); diff --git a/VideoAnalysis/appsettings.json b/VideoAnalysis/appsettings.json index dc6ee59..696ed04 100644 --- a/VideoAnalysis/appsettings.json +++ b/VideoAnalysis/appsettings.json @@ -45,9 +45,17 @@ "SqlType": "MySql", "UpdateTable": false }, - "KnowsDB": { - "ConnectionString": "Server=47.109.35.116;Database=ResourceBank;UID=live;Password=Woshiren^&*();MultipleActiveResultSets=true;Encrypt=True;TrustServerCertificate=True;", - "SqlType": "SqlServer" - } + "OtherDBArr": [ + { + "ConfigId": 1001, //ResourceBank + "ConnectionString": "Server=47.109.35.116;Database=ResourceBank;UID=live;Password=Woshiren^&*();MultipleActiveResultSets=true;Encrypt=True;TrustServerCertificate=True;", + "SqlType": "SqlServer" + }, + { + "ConfigId": 1002, //App.public.live + "ConnectionString": "Server=47.109.35.116;Database=App.public.live;UID=live;Password=Woshiren^&*();MultipleActiveResultSets=true;Encrypt=True;TrustServerCertificate=True;", + "SqlType": "SqlServer" + } + ] } } diff --git a/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs b/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs index 86cd8e6..2325f4e 100644 --- a/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs +++ b/VideoAnalysisCore/AICore/GPT/ChatGPT/Chat_GPT.cs @@ -10,6 +10,7 @@ using VideoAnalysisCore.AICore.GPT.Dto; using VideoAnalysisCore.AICore.GPT; using System.Threading.Tasks; using VideoAnalysisCore.AICore.SherpaOnnx; +using VideoAnalysisCore.Model.钃濋哺鏅哄簱; namespace VideoAnalysisCore.AICore.GPT.ChatGPT { diff --git a/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs b/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs index 5f9f3fa..a013a57 100644 --- a/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs +++ b/VideoAnalysisCore/AICore/GPT/DeepSeek/DeepSeek_GPT.cs @@ -10,6 +10,7 @@ using VideoAnalysisCore.AICore.GPT.Dto; using System.Threading.Tasks; using VideoAnalysisCore.AICore.GPT.ChatGPT; using VideoAnalysisCore.AICore.SherpaOnnx; +using VideoAnalysisCore.Model.钃濋哺鏅哄簱; namespace VideoAnalysisCore.AICore.GPT.DeepSeek { @@ -58,7 +59,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek string title = taskInfo.MediaName; var fileNameResFormat = "{鎺堣绔犺妭: string|null}"; var fileNamePostMessages = title + - " 杩欐槸涓鍫傝鐨勬爣棰,璇蜂綘鍩轰簬鏍囬甯垜鍒嗘瀽鍑鸿繖鍫傝鎵璁叉巿鐨勫唴瀹逛笌鏈鎭板綋鐨勬巿璇剧珷鑺(灏藉彲鑳界殑鍏宠仈鏈璐村垏鐨勭珷鑺傚苟涓斿氨淇濈暀涓涓)." + + " 杩欐槸涓鍫傝鐨勬爣棰,璇蜂綘鍩轰簬鏍囬甯垜鍒嗘瀽鍑鸿繖鍫傝鎵璁叉巿鐨勫唴瀹逛笌鏈鎭板綋鐨勬巿璇剧珷鑺(鍏宠仈鏈璐村垏鐨勭珷鑺,淇濈暀涓涓珷鑺!)." + $"绔犺妭鑼冨洿闄愬畾鍦╗{string.Join(',', xkwKnows)}]鑼冨洿." + $"杈撳嚭鏍煎紡 json瀛楃涓 瀵硅薄鏍煎紡{fileNameResFormat}"; var fileNameInfoRes = await ChatAsync(task, fileNamePostMessages, null);//, "deepseek-chat"); @@ -90,7 +91,8 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek $"浠庢彁鍙栧嚭鐨<鐭ヨ瘑鍧>鍐呭绉版潵鍖归厤鎴戞彁渚涚殑鐭ヨ瘑鐐,鏉ヤ綔涓虹墖娈电殑鐭ヨ瘑鐐(璇风‘淇濆尮閰嶇殑鐭ヨ瘑鐐规槸鐢ㄦ埛鎻愪緵鐨,鍚﹀垯鐗囨鐭ヨ瘑鐐瑰间负绌哄瓧绗︿覆)銆" + $"鎻愪緵鐨勬柟娉曠偣鍚嶇О({knows})銆 鏍煎紡 (鏂规硶鐐笽d|鏂规硶鐐瑰悕绉) 濡傛灉涓涓<鐭ヨ瘑鍧>鍑虹幇澶氫釜鐭ヨ瘑鐐归偅涔堢煡璇嗙偣Id涓庣煡璇嗙偣鍚嶇О閮界敤閫楀彿','鍒嗗壊銆" + $"杩欐槸杈撳叆鐨勮棰戝瓧骞曞苟涓旀槸鍖呭惈鏃堕棿鎴崇殑瑙嗛瀛楀箷鐨勫浐瀹氭牸寮忔枃鏈" + - $"瀛楀箷鏍煎紡(璇磋瘽浜:寮濮嬬:缁撴潫绉:鍐呭|涓嬩竴娈靛瓧骞).浠ヤ笅鏄寘鍚椂闂寸殑瑙嗛瀛楀箷鏂囨湰銆傚瓧骞曞垪琛 {captions.Captions}銆" + + //$"瀛楀箷鏍煎紡(璇磋瘽浜:寮濮嬬:缁撴潫绉:鍐呭|涓嬩竴娈靛瓧骞).浠ヤ笅鏄寘鍚椂闂寸殑瑙嗛瀛楀箷鏂囨湰銆傚瓧骞曞垪琛 {captions.Captions}銆" + + $"瀛楀箷鏍煎紡(寮濮嬬:缁撴潫绉:鍐呭|涓嬩竴娈靛瓧骞).浠ヤ笅鏄寘鍚椂闂寸殑瑙嗛瀛楀箷鏂囨湰銆傚瓧骞曞垪琛 {captions.Captions}銆" + $"鏈鍚庤妫鏌ユ煇浜<鐭ヨ瘑鍧>涔嬮棿鐨勮繃娓℃槸鍚﹁嚜鐒,濡傛灉<鐭ヨ瘑鍧>鏃堕暱瓒呰繃500绉掑垯鑰冭檻鎷嗗皝涓轰袱涓洿鍔犺创鍒囩殑<鐭ヨ瘑鍧>.鎴栬<鐭ヨ瘑鍧>鏃堕暱灏忎簬30绉掑垯鑰冭檻鍚堝苟<鐭ヨ瘑鍧>鍒扮浉閭荤殑<鐭ヨ瘑鍧>)銆" + $"杈撳嚭鏍煎紡({resFormat})"; @@ -111,8 +113,10 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek } var thems = string.Join(',', questionRes.Select(s => s.StartTime + "->" + s.Theme)); - var checkResFormat = """{"Score":鎵撳垎(number),"Evaluation":璇勪环(string)}"""; - var checkMessage = "鎴戜负瑙嗛鐨勮瑙e唴瀹瑰仛浜嗕竴浜涘垎娈,浣犺兘甯垜妫鏌ヤ笅杩欎簺鍒嗘鐨勬椂闂村垎閰嶅悎鐞嗗悧?璇风粰鍑轰綘鐨勬墦鍒(0-100,70鍒嗗強鏍)浠ュ強璇勪环" + + var checkResFormat = """{"Score":鎵撳垎(number),"Evaluation":璇勪环(string),"Data":浼樺寲鍚庣殑鍒嗘(array)}"""; + var checkResFormat1 = """[{"Start":寮濮嬬(number),"Theme":浼樺寲鍚庣殑鍒嗘涓婚(string)}]"""; + var checkMessage = "鎴戜负瑙嗛鐨勮瑙e唴瀹瑰仛浜嗕竴浜涘垎娈,浣犺兘甯垜妫鏌ヤ笅杩欎簺鍒嗘鐨勬椂闂村垎閰嶆槸鍚﹀悎鐞,鏍囬鍐呭绗﹀悎瀹為檯鍚?" + + $"璇风粰鍑轰綘鐨勬墦鍒(0-100,70鍒嗗強鏍)浠ュ強鎵撳垎鍘熷洜,骞朵笖缁欏嚭浼樺寲鍚庣殑鍒嗘 鍒嗘鏍煎紡(${checkResFormat1})" + $"杩欐槸鎴戠殑鍒嗘 {thems}." + $"鍚庣画鐨勫唴瀹规槸鍖呭惈鏃堕棿鎴崇殑瑙嗛瀛楀箷鐨勫浐瀹氭牸寮忔枃鏈" + $"瀛楀箷鏍煎紡(璇磋瘽浜:寮濮嬬:缁撴潫绉:鍐呭|涓嬩竴娈靛瓧骞).浠ヤ笅鏄寘鍚椂闂寸殑瑙嗛瀛楀箷鏂囨湰銆傚瓧骞曞垪琛 {captions.Captions}銆" + @@ -130,7 +134,7 @@ namespace VideoAnalysisCore.AICore.GPT.DeepSeek } } - + //todo 鏈寘鍚殑鐭ヨ瘑鐐圭墖娈 濡備綍澶勭悊 var insertData = questionRes .Where(s => !string.IsNullOrEmpty(s.KnowPoint)) .SelectMany( diff --git a/VideoAnalysisCore/AICore/GPT/Dto/QuestionRes.cs b/VideoAnalysisCore/AICore/GPT/Dto/QuestionRes.cs index 0e1992f..88ab059 100644 --- a/VideoAnalysisCore/AICore/GPT/Dto/QuestionRes.cs +++ b/VideoAnalysisCore/AICore/GPT/Dto/QuestionRes.cs @@ -138,6 +138,7 @@ namespace VideoAnalysisCore.AICore.GPT.Dto /// 璇勫垎 /// public string Evaluation { get; set; } + public VideoKnowRes[] Data { get; set; } } /// diff --git a/VideoAnalysisCore/Common/AppCommon.cs b/VideoAnalysisCore/Common/AppCommon.cs index 4650deb..46194d9 100644 --- a/VideoAnalysisCore/Common/AppCommon.cs +++ b/VideoAnalysisCore/Common/AppCommon.cs @@ -46,16 +46,11 @@ namespace VideoAnalysisCore.Common .Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false))); DbMatserType = assembliesType .Where(u => u.GetInterfaces().Contains(typeof(IDB))); - KnowsType = assembliesType - .Where(u =>u.GetInterfaces().Contains(typeof(IKnowsDB))); } catch { throw; } - //.Where(u => !u.IsDefined(typeof(SplitTableAttribute), false)) - //.Where(u => !typeof(Model.DataCenterYH.IDataCenterYHModel).IsAssignableFrom(u)) - //.Where(u => !u.IsSubclassOf(typeof(YQ_BaseEntity))); } /// @@ -225,11 +220,11 @@ namespace VideoAnalysisCore.Common var stringBuilder = new StringBuilder(); foreach (var item in results) { - stringBuilder.Append(item.Value.First()); + //stringBuilder.Append(item.Value.First()); + //stringBuilder.Append(":"); + stringBuilder.Append((int)item.Key.Start); stringBuilder.Append(":"); - stringBuilder.Append(item.Key.Start); - stringBuilder.Append(":"); - stringBuilder.Append(item.Key.End); + stringBuilder.Append((int)item.Key.End); stringBuilder.Append(":"); stringBuilder.Append(item.Key.Text); stringBuilder.Append("|"); @@ -370,6 +365,10 @@ namespace VideoAnalysisCore.Common /// 鍚姩鏃舵洿鏂拌〃缁撴瀯 /// public bool UpdateTable { get; set; } + /// + /// 閰嶇疆ID + /// + public long ConfigId { get; set; } } /// @@ -401,14 +400,14 @@ namespace VideoAnalysisCore.Common /// ChatGpt /// public ChatGptConfig ChatGpt { get; set; } = new ChatGptConfig(); + + /// /// 鏁版嵁搴撻厤缃 /// public DBConfig DB { get; set; } = new DBConfig(); - /// - /// 鐭ヨ瘑鐐规暟鎹簱 - /// - public DBConfig KnowsDB { get; set; } = new DBConfig(); + + public DBConfig[] OtherDBArr { get; set; } = Array.Empty(); } } diff --git a/VideoAnalysisCore/Common/CoravelExpand.cs b/VideoAnalysisCore/Common/CoravelExpand.cs new file mode 100644 index 0000000..b4a1438 --- /dev/null +++ b/VideoAnalysisCore/Common/CoravelExpand.cs @@ -0,0 +1,31 @@ +锘縰sing Coravel; +using Coravel.Scheduling.Schedule; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VideoAnalysisCore.Job; + +namespace VideoAnalysisCore.Common +{ + public static class CoravelExpand + { + public static int MyProperty { get; set; } + public static void Init(IServiceCollection service) + { + + service.AddScheduler(); + service.AddTransient(); + } + public static void Run(IServiceProvider provider) + { + provider.UseScheduler(scheduler => + { + //姣5鍒嗛挓鎵ц涓娆 鏈鐞嗚棰戞壂鎻 + scheduler.Schedule().EveryFiveMinutes(); + }); + } + } +} diff --git a/VideoAnalysisCore/Common/DownloadFile.cs b/VideoAnalysisCore/Common/DownloadFile.cs index cc828a6..a5ceb4b 100644 --- a/VideoAnalysisCore/Common/DownloadFile.cs +++ b/VideoAnalysisCore/Common/DownloadFile.cs @@ -139,12 +139,12 @@ namespace VideoAnalysisCore.Common download.DownloadProgressChanged += (object? sender, Downloader.DownloadProgressChangedEventArgs e) => { pI++; - if(pI%20==0) + if (pI % 20 == 0) RedisExpand.SetTaskProgress(task, e.ProgressPercentage); }; - download.DownloadFileCompleted +=async (object? sender, AsyncCompletedEventArgs e) => + download.DownloadFileCompleted += async (object? sender, AsyncCompletedEventArgs e) => { - if (download.Status == DownloadStatus.Failed && e.Error!=null) + if (download.Status == DownloadStatus.Failed && e.Error != null) { await RedisExpand.SetTaskErrorMessage(long.Parse(task), e.Error) .ConfigureAwait(false);//涓嶅垏鍥炰笂涓嬫枃 diff --git a/VideoAnalysisCore/Common/RedisExpand.cs b/VideoAnalysisCore/Common/RedisExpand.cs index d5acafd..6de3f7a 100644 --- a/VideoAnalysisCore/Common/RedisExpand.cs +++ b/VideoAnalysisCore/Common/RedisExpand.cs @@ -168,6 +168,13 @@ namespace VideoAnalysisCore.Common var taskData = await DbScoped.SugarScope.Queryable() .FirstAsync(s => s.Id == tId); + if (taskData.Captions == "[]") + taskData.Captions = (await Redis.HMGetAsync(RedisExpandKey.Task(task), "Captions")).First(); + if (taskData.Speaker == "[]") + taskData.Speaker = (await Redis.HMGetAsync(RedisExpandKey.Task(task), "Speaker")).First(); + + + taskData.ChatAnalysis =JsonSerializer.Serialize(gptRes); taskData.ChatAnalysisScore = gptRes?.Assessment?.Merit?.Sum(s => s.Score) ?? 0; taskData.ErrorMessage = string.Empty; @@ -176,6 +183,8 @@ namespace VideoAnalysisCore.Common .UpdateColumns(it => new { it.ChatAnalysis, + it.Captions, + it.Speaker, it.ChatAnalysisScore, it.ErrorMessage, it.TotalTokens, diff --git a/VideoAnalysisCore/Common/Repository.cs b/VideoAnalysisCore/Common/Repository.cs index 235516c..b5e5602 100644 --- a/VideoAnalysisCore/Common/Repository.cs +++ b/VideoAnalysisCore/Common/Repository.cs @@ -3,6 +3,7 @@ using SqlSugar.IOC; using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using VideoAnalysisCore.Interface; @@ -12,13 +13,25 @@ namespace VideoAnalysisCore.Common { public class Repository : SimpleClient where T : class, new() { + readonly Dictionary CID= new Dictionary(); public Repository() { - if(typeof(T).GetInterfaces().Contains(typeof(IKnowsDB))) - base.Context = DbScoped.SugarScope.GetConnection(1001); - else - base.Context = DbScoped.SugarScope; + SwitchConnection(); + } + public void SwitchConnection() + { + var t = typeof(T); + if (CID.ContainsKey(t)) + { + base.Context = DbScoped.SugarScope.GetConnectionScope(CID[t]); + return; + } + var c = t.GetCustomAttribute(); + if (!CID.ContainsKey(typeof(T))) + CID.Add(typeof(T), c?.configId); + base.Context = c != null + ? DbScoped.SugarScope.GetConnectionScope(c.configId) + : DbScoped.SugarScope; } - } } diff --git a/VideoAnalysisCore/Common/SqlSugarExpand.cs b/VideoAnalysisCore/Common/SqlSugarExpand.cs index db1d159..a9ebbcf 100644 --- a/VideoAnalysisCore/Common/SqlSugarExpand.cs +++ b/VideoAnalysisCore/Common/SqlSugarExpand.cs @@ -27,15 +27,15 @@ namespace VideoAnalysisCore.Common ConnectionString = AppCommon.Config.DB.ConnectionString, DbType =AppCommon.Config.DB.SqlType, IsAutoCloseConnection = true//鑷姩閲婃斁 - }, - new IocConfig() - { - ConfigId =1001, - ConnectionString = AppCommon.Config.KnowsDB.ConnectionString, - DbType =AppCommon.Config.KnowsDB.SqlType, - IsAutoCloseConnection = true//鑷姩閲婃斁 }, }; + dbList.AddRange(AppCommon.Config.OtherDBArr.Select(s => new IocConfig() + { + ConfigId=s.ConfigId, + ConnectionString=s.ConnectionString, + DbType=s.SqlType, + IsAutoCloseConnection = true + })); services.AddSingleton(typeof(Repository<>)); //娉ㄥ叆SqlSugar 涓诲簱 diff --git a/VideoAnalysisCore/Enum/TaskTypeEnum.cs b/VideoAnalysisCore/Enum/TaskTypeEnum.cs index 333b326..69d3389 100644 --- a/VideoAnalysisCore/Enum/TaskTypeEnum.cs +++ b/VideoAnalysisCore/Enum/TaskTypeEnum.cs @@ -10,12 +10,16 @@ namespace VideoAnalysisCore.Enum public enum TaskTypeEnum { /// - /// 钃濋哺鏅哄簱瑙嗛鍒嗘瀽 + /// 钃濋哺鏅哄簱_瑙嗛鍒嗘 /// - 钃濋哺鏅哄簱_瑙嗛鍒嗘瀽, + 钃濋哺鏅哄簱_瑙嗛鍒嗘 = 0, + /// + /// 钃濋哺鏅哄簱_涓亴瑙嗛鍒嗘 + /// + 钃濋哺鏅哄簱_涓亴瑙嗛鍒嗘 = 100, /// /// 鏁欑爺浼氳_瑙嗛鍒嗘瀽 /// - 鏁欑爺浼氳_瑙嗛鍒嗘瀽 + 鏁欑爺浼氳_瑙嗛鍒嗘瀽 = 200, } } diff --git a/VideoAnalysisCore/Interface/IKnowsDB.cs b/VideoAnalysisCore/Interface/IKnowsDB.cs deleted file mode 100644 index 4aa5abe..0000000 --- a/VideoAnalysisCore/Interface/IKnowsDB.cs +++ /dev/null @@ -1,15 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VideoAnalysisCore.Interface -{ - /// - /// 琛ㄥ睘浜嶬nowsDB - /// - interface IKnowsDB - { - } -} diff --git a/VideoAnalysisCore/Job/UnprocessedVideoJob.cs b/VideoAnalysisCore/Job/UnprocessedVideoJob.cs new file mode 100644 index 0000000..224835a --- /dev/null +++ b/VideoAnalysisCore/Job/UnprocessedVideoJob.cs @@ -0,0 +1,28 @@ +锘縰sing 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/HotwordMode.cs b/VideoAnalysisCore/Model/Dto/HotwordMode.cs similarity index 100% rename from VideoAnalysisCore/Model/HotwordMode.cs rename to VideoAnalysisCore/Model/Dto/HotwordMode.cs diff --git a/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Attachments.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Attachments.cs new file mode 100644 index 0000000..66296fa --- /dev/null +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Attachments.cs @@ -0,0 +1,182 @@ +锘縰sing System; +using System.Linq; +using System.Text; +using SqlSugar; +using VideoAnalysisCore.Interface; + +namespace App.Model +{ + /// + ///鏂囦欢闄勪欢 + /// + [SugarTable("Attachments")] + [Tenant("1002")] + public partial class Attachments + { + public Attachments() + { + + this.SchoolId = Convert.ToInt64("0"); + this.Sort = Convert.ToInt32("0"); + this.CreateTime = DateTime.Now; + this.DeleteState = false; + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey = true)] + public long Id { get; set; } + + /// + /// Desc:鍏宠仈瀵硅薄绫诲瀷(鏋氫妇) + /// Default: + /// Nullable:False + /// + public int ObjType { get; set; } + + /// + /// Desc:鏂囦欢鍚嶇О + /// Default: + /// Nullable:False + /// + [SugarColumn(Length = 500)] + public string Name { get; set; } + + /// + /// Desc:鑷畾涔夊悕绉 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 200)] + public string CustomName { get; set; } + + /// + /// Desc:鏂囦欢绫诲瀷 + /// Default: + /// Nullable:False + /// + [SugarColumn(Length = 100)] + public string Type { get; set; } + + /// + /// Desc:閾炬帴 + /// Default: + /// Nullable:False + /// + [SugarColumn(Length = 255)] + public string Url { get; set; } + + /// + /// Desc:鎵╁睍鍚 + /// Default: + /// Nullable:False + /// + [SugarColumn(Length = 20)] + public string Extension { get; set; } + + /// + /// Desc:鏂囦欢澶у皬(KB) + /// Default: + /// Nullable:False + /// + [SugarColumn(Length = 11, DecimalDigits = 2)] + public decimal Size { get; set; } + + /// + /// Desc:瀛︽牎 + /// Default:0 + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public long? SchoolId { get; set; } + + /// + /// Desc:鏃堕暱 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 10, DecimalDigits = 2)] + public decimal? Duration { get; set; } + + /// + /// Desc:鎺掑簭 + /// Default:0 + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? Sort { get; set; } + + /// + /// Desc:瑙嗛鐮 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public string VideoCode { get; set; } + + /// + /// Desc:骞寸骇 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public string GradeName { get; set; } + + /// + /// Desc:绉戠洰 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public string SubjectName { get; set; } + + /// + /// Desc:鐝骇 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public string ClassName { get; set; } + + /// + /// Desc:鍒涘缓鏃堕棿 + /// Default:DateTime.Now + /// Nullable:False + /// + public DateTime CreateTime { get; set; } + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + public bool DeleteState { get; set; } + /// + /// 杞崲鍚庣殑鍥剧墖鏁伴噺 + /// + [SugarColumn(IsNullable = true)] + public int ConvertPageCount { get; set; } + + /// + /// 鏂囦欢鎵灞炵被鍨 + /// + [SugarColumn(IsNullable = true, DefaultValue = "0")] + public int DataType { get; set; } + + [SugarColumn(IsIgnore = true)] + public string DataTypeName { get; set; } + + [SugarColumn(ColumnDescription = "鏂板鐢ㄦ埛id", IsNullable = true)] + public long AdminId { get; set; } + + [SugarColumn(ColumnDescription = "鏂板鐢ㄦ埛瑙掕壊id", IsNullable = true)] + public long AdminRoleId { get; set; } + + + } + + +} diff --git a/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContent.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContent.cs new file mode 100644 index 0000000..eb3738a --- /dev/null +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContent.cs @@ -0,0 +1,128 @@ +锘縰sing System; +using System.Linq; +using System.Text; +using SqlSugar; +using VideoAnalysisCore.Interface; + +namespace App.Model +{ + /// + /// 鏂囦欢鍐呭琛 + /// + [SugarTable("FileContent")] + [Tenant("1002")] + public partial class FileContent + { + public FileContent(){ + + this.Sort =Convert.ToInt32("0"); + this.CreateTime =DateTime.Now; + this.DeleteState =false; + + } + + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public long Id {get;set;} + + /// + /// Desc:鍐呭鍚嶇О + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鍐呭鍚嶇О", ColumnDataType = "nvarchar(500)", IsNullable = false)] + public string FileName {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "瀛︽牎id", IsNullable = true)] + public long? SchoolId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "瀛︽牎鍚嶇О", ColumnDataType = "nvarchar(100)", IsNullable = true)] + public string SchoolName {get;set;} + + /// + /// Desc:骞寸骇 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "骞寸骇", ColumnDataType = "nvarchar(30)", IsNullable = true)] + public string GradeName {get;set;} + + /// + /// Desc:绉戠洰 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "绉戠洰", IsNullable = true)] + + public int? SubjectId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "绉戠洰鍚嶇О", ColumnDataType = "nvarchar(50)", IsNullable = true)] + public string SubjectName {get;set;} + + /// + /// Desc:鏂囦欢绯荤粺鐩綍id + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "浠剁郴缁熺洰褰昳d", IsNullable = false)] + public long FileDirectoryId {get;set;} + + /// + /// Desc: + /// Default:0 + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鎺掑簭", IsNullable = false, DefaultValue = "0")] + public int Sort {get;set;} + + + public DateTime CreateTime {get;set;} + + public bool DeleteState {get;set;} + + /// + /// Desc:鏂囦欢鍖匢d + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鏂囦欢鍖卛d", IsNullable = false)] + public long BagId {get;set;} + + /// + /// Desc:浣滆 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "浣滆", ColumnDataType = "nvarchar(200)", IsNullable = true)] + public string Author {get;set;} + + /// + /// 鏄惁鍙互涓嬭浇 + /// + public bool DownState { get; set; } + /// + /// 绠$悊鍛榠d + /// + [SugarColumn(ColumnDescription = "绠$悊鍛榠d", IsNullable = true)] + public long? AdminId { get; set; } + /// + /// 绠$悊鍛樿鑹瞚d + /// + [SugarColumn(ColumnDescription = "绠$悊鍛樿鑹瞚d", IsNullable = true)] + public long? AdminRoleId { get; set; } + } +} diff --git a/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContentMaterial.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContentMaterial.cs new file mode 100644 index 0000000..a79eb62 --- /dev/null +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileContentMaterial.cs @@ -0,0 +1,66 @@ +锘縰sing System; +using System.Linq; +using System.Text; +using SqlSugar; +using VideoAnalysisCore.Interface; + +namespace App.Model +{ + /// + /// + /// + [SugarTable("FileContentMaterial")] + [Tenant("1002")] + public partial class FileContentMaterial + { + public FileContentMaterial(){ + + this.CreateTime =DateTime.Now; + this.DeleteState =false; + + } + /// + /// Desc:鏂囦欢绯荤粺鍐呭 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public long Id {get;set;} + + /// + /// Desc:鏂囦欢绯荤粺鍐呭 + /// Default: + /// Nullable:False + /// + public long FileContentId {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:0 + /// Nullable:False + /// + public bool DeleteState {get;set;} + + public int Sort { get; set; } + + /// + /// 鏄惁鍙互涓嬭浇 + /// + public bool DownState { get; set; } = false; + + } +} diff --git a/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileDirectory.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileDirectory.cs new file mode 100644 index 0000000..e0e3173 --- /dev/null +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/FileDirectory.cs @@ -0,0 +1,161 @@ +锘縰sing System; +using System.Linq; +using System.Text; +using SqlSugar; +using VideoAnalysisCore.Interface; + +namespace App.Model +{ + /// + /// 鏂囦欢鐩綍琛 + /// + [SugarTable("FileDirectory")] + [Tenant("1002")] + public partial class 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(""); + + } + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public long Id {get;set;} + + /// + /// Desc:鍚嶇О + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鍚嶇О", ColumnDataType = "nvarchar(50)", IsNullable = false)] + public string Name {get;set;} + + /// + /// Desc:鎺掑簭 + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鎺掑簭", IsNullable = false)] + public int Sort {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 + /// + [SugarColumn(ColumnDescription = "鏄惁鑷姩鎺堟潈", IsNullable = false, DefaultValue = "1")] + public bool IsCheckedSelect {get;set;} + + /// + /// Desc:鏄惁鏈鍚庝竴绾ц妭鐐 + /// Default:0 + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鏄惁鏈鍚庝竴绾ц妭鐐", IsNullable = false, DefaultValue = "0")] + public bool IsLastNode {get;set;} + + /// + /// Desc:涓婄骇id + /// Default:0 + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "涓婄骇id", IsNullable = false, DefaultValue = "0")] + public long ParentId {get;set;} + + + 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;} + + /// + /// Desc:鏄惁鍏紑 + /// Default:0 + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "鏄惁鍏紑", IsNullable = true, DefaultValue = "0")] + public bool? IsPublic {get;set;} + + /// + /// 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;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "鏇存柊鏃堕棿", IsNullable = true)] + public DateTime? UpdateTime {get;set;} + + /// + /// Desc:璇剧▼id锛堟潵婧恈ourseinfo锛 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "璇剧▼id锛堟潵婧恈ourseinfo锛", IsNullable = true)] + public long? CourseId {get;set;} + + /// + /// Desc:鏁欐潗鐗堟湰id锛堟潵婧 textboox_versions锛 + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "鏁欐潗鐗堟湰id锛堟潵婧 textboox_versions锛", IsNullable = true)] + public long? VersionsId {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "", ColumnDataType = "nvarchar(50)", IsNullable = true)] + public string Code {get;set;} + + /// + /// Desc:鏍硅妭鐐筰d + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "鏍硅妭鐐筰d", IsNullable = true)] + public long? RootId {get;set;} + /// + /// 绠$悊鍛榠d + /// + [SugarColumn(ColumnDescription = "绠$悊鍛榠d", IsNullable = true)] + public long? AdminId { get; set; } + /// + /// 绠$悊鍛樿鑹瞚d + /// + [SugarColumn(ColumnDescription = "绠$悊鍛樿鑹瞚d", IsNullable = true)] + public long? AdminRoleId { get; set; } + + } +} diff --git a/VideoAnalysisCore/Model/KnowledgeInfo.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/KnowledgeInfo.cs similarity index 93% rename from VideoAnalysisCore/Model/KnowledgeInfo.cs rename to VideoAnalysisCore/Model/钃濋哺鏅哄簱/KnowledgeInfo.cs index 39905bb..6825515 100644 --- a/VideoAnalysisCore/Model/KnowledgeInfo.cs +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/KnowledgeInfo.cs @@ -6,10 +6,14 @@ using System.Text; using System.Threading.Tasks; using VideoAnalysisCore.Interface; -namespace VideoAnalysisCore.Model +namespace VideoAnalysisCore.Model.钃濋哺鏅哄簱 { + /// + /// 钃濋哺鏅哄簱 鐭ヨ瘑鐐硅〃 + /// [SugarTable("knowledgeinfo")] - public class KnowledgeInfo : IKnowsDB + [Tenant("1001")] + public class KnowledgeInfo { [SugarColumn(IsPrimaryKey = true, ColumnDescription = "Id 涓婚敭", ColumnName = "id")] public long Id { get; set; } diff --git a/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Material.cs b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Material.cs new file mode 100644 index 0000000..49cd3e8 --- /dev/null +++ b/VideoAnalysisCore/Model/钃濋哺鏅哄簱/Material.cs @@ -0,0 +1,110 @@ +锘縰sing System; +using System.Linq; +using System.Text; +using SqlSugar; +using VideoAnalysisCore.Interface; + +namespace App.Model +{ + /// + ///绱犳潗琛 + /// + [SugarTable("Material")] + [Tenant("1002")] + public partial class Material + { + public Material() + { + + this.TagId = Convert.ToInt64("0"); + this.CreateTime = DateTime.Now; + this.DeleteState = false; + this.DownState = false; + } + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// Desc:绱犳潗缂栧彿 + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "绱犳潗缂栧彿", ColumnDataType = "nvarchar(50)", IsNullable = false)] + public string MaterialNo { get; set; } + + /// + /// Desc:绱犳潗绫诲瀷锛1锛氳棰戯紱2锛 鏂囦欢锛3锛氶煶棰戯紱4锛氬浘鐗囷紱锛 + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "绱犳潗绫诲瀷锛1锛氳棰戯紱2锛 鏂囦欢锛3锛氶煶棰戯紱4锛氬浘鐗囷紱锛", IsNullable = false)] + public int MaterialType { get; set; } + + /// + /// Desc:鏍囩Id + /// Default:0 + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "绱犳爣绛綢d", IsNullable = false,DefaultValue ="0")] + public long TagId { get; set; } + + /// + /// Desc:绱犳潗鍚嶇О + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "绱犳潗鍚嶇О", ColumnDataType = "nvarchar(500)", IsNullable = false)] + public string MaterialName { get; set; } + + /// + /// Desc:闄勪欢id + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "闄勪欢id",IsNullable = false)] + public long AttachmentsId { get; set; } + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(ColumnDescription = "鍐呭", ColumnDataType = "nvarchar(max)", IsNullable = true)] + public string Desc { get; set; } + + public DateTime CreateTime { get; set; } + + public bool DeleteState { get; set; } + + /// + /// 鏂板鐢ㄦ埛id + /// + [SugarColumn(ColumnDescription = "鏂板鐢ㄦ埛id")] + public long CreateUserId { get; set; } + + /// + /// Desc:鏂板鐢ㄦ埛鍚嶇О + /// Default: + /// Nullable:False + /// + [SugarColumn(ColumnDescription = "鏂板鐢ㄦ埛鍚嶇О",ColumnDataType = "nvarchar(50)")] + public string CreateUserName { get; set; } + + [SugarColumn(ColumnDescription = "瀛︽牎id",IsNullable =true)] + public long SchoolId { get; set; } + + [SugarColumn(ColumnDescription = "瀛︽牎鍚嶇О", ColumnDataType = "nvarchar(50)", IsNullable = true)] + public string SchoolName { get; set; } + /// + /// 鏄惁鍙互涓嬭浇 + /// + [SugarColumn(ColumnDescription = "鏄惁鍙互涓嬭浇", DefaultValue ="0")] + public bool DownState { get; set; } + /// + /// 鏂板鐢ㄦ埛瑙掕壊id + /// + [SugarColumn(ColumnDescription = "鏂板鐢ㄦ埛瑙掕壊id",IsNullable =true)] + public long AdminRoleId { get; set; } + } +} diff --git a/VideoAnalysisCore/VideoAnalysisCore.csproj b/VideoAnalysisCore/VideoAnalysisCore.csproj index 7722e4f..ee585c8 100644 --- a/VideoAnalysisCore/VideoAnalysisCore.csproj +++ b/VideoAnalysisCore/VideoAnalysisCore.csproj @@ -57,6 +57,7 @@ +