diff --git a/OpenAuth.App/ServiceApp/FlyTask/Response/CommandVideoResponse.cs b/OpenAuth.App/ServiceApp/FlyTask/Response/CommandVideoResponse.cs new file mode 100644 index 0000000..b57cebc --- /dev/null +++ b/OpenAuth.App/ServiceApp/FlyTask/Response/CommandVideoResponse.cs @@ -0,0 +1,17 @@ +namespace OpenAuth.App.ServiceApp.FlyTask.Response; + +public class CommandVideoResponse +{ + public bool issuccess { get; set; } + public byte[] imgBlob { get; set; } + public VideoExtData spkzxx { get; set; } + public string videoLink { get; set; } +} + +public class VideoExtData +{ + public float? lon { get; set; } + public float? lat { get; set; } + public float? angle { get; set; } + public float? height { get; set; } +} \ No newline at end of file diff --git a/OpenAuth.App/ServiceApp/ManageApp.cs b/OpenAuth.App/ServiceApp/ManageApp.cs index b5b414b..9cfe740 100644 --- a/OpenAuth.App/ServiceApp/ManageApp.cs +++ b/OpenAuth.App/ServiceApp/ManageApp.cs @@ -1529,6 +1529,7 @@ namespace OpenAuth.App.ServiceApp .AsQueryable() .Where(r => r.FlightId == flightId) .Where(r => r.ObjectKey.Contains("/Remote-Control")) + .Where(r=>r.ObjectKey.Contains(".jpeg")) .Where(r => r.CreateTime > DateTimeOffset.FromUnixTimeMilliseconds(timestamp)) .SingleAsync(); if (lasaMediaFile == null) @@ -1575,6 +1576,45 @@ namespace OpenAuth.App.ServiceApp } }; } + + + public async Task> GetTaskVideoList(string flightId, long timestamp) + { + var lasaMediaFile = await Repository.ChangeRepository>() + .AsQueryable() + .Where(r => r.FlightId == flightId) + .Where(r => r.ObjectKey.Contains("/Remote-Control")) + .Where(r=>r.ObjectKey.Contains("S.mp4")) + .Where(r => r.CreateTime > DateTimeOffset.FromUnixTimeMilliseconds(timestamp)) + .SingleAsync(); + if (lasaMediaFile == null) + { + return new Response() + { + Result = new CommandVideoResponse() + }; + } + return new Response() + { + Result = new CommandVideoResponse() + { + videoLink = "http://" + _minioService.endPoint + "/" + _minioService._bucketName + "/" + + lasaMediaFile.ObjectKey, + spkzxx = new VideoExtData() + { + lon = lasaMediaFile.Lng, + lat = lasaMediaFile.Lat, + angle = lasaMediaFile.GimbalYawDegree, + height = lasaMediaFile.RelativeAltitude + } + } + }; + } + /// + /// 获取图片信息 + /// + /// + /// public (int width, int height) GetImageDimensions(string imagePath) { using (var bmp = new Bitmap(imagePath)) diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/ManageController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/ManageController.cs index 2371800..a2e36e4 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/ManageController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/ManageController.cs @@ -264,6 +264,14 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers { return await _app.GetTaskPicList(flightId, timestamp); } + + + [HttpGet] + [AllowAnonymous] + public async Task> GetTaskVideoList(string flightId, long timestamp) + { + return await _app.GetTaskVideoList(flightId, timestamp); + } #endregion