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; } } }