From c616581918e738e98407bcbecf827a745e001f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Tue, 6 May 2025 09:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=93=9D=E9=B2=B8=E6=99=BA=E5=BA=93=E5=A4=9A=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learn.VideoAnalysis.API/AntDeploy.json | 4 +- VideoAnalysisCore/Controllers/Dto/ApiDto.cs | 9 ++++ .../Controllers/LJZK_Controller.cs | 5 ++- VideoAnalysisCore/Job/NodePackageJob.cs | 43 +++++++++++++------ VideoAnalysisCore/Model/NodePackageInfo.cs | 12 ++++++ 5 files changed, 55 insertions(+), 18 deletions(-) diff --git a/Learn.VideoAnalysis.API/AntDeploy.json b/Learn.VideoAnalysis.API/AntDeploy.json index 4dd9b44..60803ae 100644 --- a/Learn.VideoAnalysis.API/AntDeploy.json +++ b/Learn.VideoAnalysis.API/AntDeploy.json @@ -40,9 +40,9 @@ } ], "IIsConfig": { - "SdkType": null, + "SdkType": "netcore", "WebSiteName": "", - "LastEnvName": null, + "LastEnvName": "10楼刀片机", "EnvPairList": [ { "EnvName": "10楼刀片机", diff --git a/VideoAnalysisCore/Controllers/Dto/ApiDto.cs b/VideoAnalysisCore/Controllers/Dto/ApiDto.cs index ef7f08b..9960624 100644 --- a/VideoAnalysisCore/Controllers/Dto/ApiDto.cs +++ b/VideoAnalysisCore/Controllers/Dto/ApiDto.cs @@ -34,6 +34,15 @@ namespace VideoAnalysisCore.Controllers.Dto /// 内容类型 /// public AttachmentsInfoType AttachmentsInfoType { get; set; } + /// + /// 视频下载地址 + /// + public string? VideoUrl { get; set; } + /// + /// 通知回调地址 + /// + + public string? CallBackUrl { get; set; } } public class NodePackageReq { diff --git a/VideoAnalysisCore/Controllers/LJZK_Controller.cs b/VideoAnalysisCore/Controllers/LJZK_Controller.cs index b7d940d..db7aece 100644 --- a/VideoAnalysisCore/Controllers/LJZK_Controller.cs +++ b/VideoAnalysisCore/Controllers/LJZK_Controller.cs @@ -94,7 +94,8 @@ namespace VideoAnalysisCore.Controllers NodeId = req.NodeId, TaskType = req.TaskType, SubjectType = req.SubjectType, - + VideoUrl =s.VideoUrl, + CallBackUrl=s.CallBackUrl }; nodePackages.Add(np); if (s.AttachmentsInfoType == AttachmentsInfoType.PPT) @@ -109,7 +110,7 @@ namespace VideoAnalysisCore.Controllers Type = req.TaskType, Subject = req.SubjectType, TagId = s.VideoCode, - MediaUrl = string.Empty, + MediaUrl =s.VideoUrl, MediaName = s.VideoName, PPTVideoCode = req.AnalyzeItems //ȡppt videoCode .FirstOrDefault(x => x.AttachmentsInfoType == AttachmentsInfoType.PPT && s.StructurePageContentId == x.StructurePageContentId) diff --git a/VideoAnalysisCore/Job/NodePackageJob.cs b/VideoAnalysisCore/Job/NodePackageJob.cs index 111e836..52ca910 100644 --- a/VideoAnalysisCore/Job/NodePackageJob.cs +++ b/VideoAnalysisCore/Job/NodePackageJob.cs @@ -60,22 +60,37 @@ namespace VideoAnalysisCore.Job Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 已完成任务回调 数量{postData.Count}"); if (postData.Count() == 0) return; - var responseMessage = await new HttpClient() - .PostAsJsonAsync(AppCommon.Config.Subsystem.蓝鲸智库.APIUrl + "/api/callback/platform/videosAnalyze", postData); - if (responseMessage.IsSuccessStatusCode) - { - var res = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 回调结果 {res}"); + //var responseMessage = await new HttpClient() + // .PostAsJsonAsync(AppCommon.Config.Subsystem.蓝鲸智库.APIUrl + "/api/callback/platform/videosAnalyze", postData); + foreach (var item in taskArr) { + HttpResponseMessage responseMessage = null; + if (!string.IsNullOrWhiteSpace(item.CallBackUrl)) + { + responseMessage = await new HttpClient() + .PostAsJsonAsync(item.CallBackUrl, postData); + } + else + { + responseMessage = await new HttpClient() + .PostAsJsonAsync(AppCommon.Config.Subsystem.蓝鲸智库.APIUrl + "/api/callback/platform/videosAnalyze", postData); + } + if (responseMessage.IsSuccessStatusCode) + { + var res = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 回调结果 {res}"); - await nodePackageInfoDB.AsUpdateable(postData) - .UpdateColumns(it => new { it.SuccessTime }) - .ExecuteCommandAsync(); - } - else - { - var res = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 回调失败!!! {responseMessage.StatusCode} {res}"); + await nodePackageInfoDB.AsUpdateable(postData) + .UpdateColumns(it => new { it.SuccessTime }) + .ExecuteCommandAsync(); + } + else + { + var res = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 回调失败!!! {responseMessage.StatusCode} {res}"); + } + await Task.Delay(1000); } + } } } diff --git a/VideoAnalysisCore/Model/NodePackageInfo.cs b/VideoAnalysisCore/Model/NodePackageInfo.cs index bfc7609..8681a51 100644 --- a/VideoAnalysisCore/Model/NodePackageInfo.cs +++ b/VideoAnalysisCore/Model/NodePackageInfo.cs @@ -71,5 +71,17 @@ namespace VideoAnalysisCore.Model /// [DisplayName("创建时间")] public DateTime CreateTime { get; set; } =DateTime.Now; + + /// + /// 视频下载地址 + /// + [SugarColumn(Length = 500)] + public string VideoUrl { get; set; } + /// + /// 通知回调地址 + /// + + [SugarColumn(Length = 500)] + public string CallBackUrl { get; set; } } }