指令录像查询

main
陈伟 2 months ago
parent a83596d2d8
commit fb777b7820

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

@ -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<Response<CommandVideoResponse>> GetTaskVideoList(string flightId, long timestamp)
{
var lasaMediaFile = await Repository.ChangeRepository<SugarRepositiry<LasaMediaFile>>()
.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<CommandVideoResponse>()
{
Result = new CommandVideoResponse()
};
}
return new Response<CommandVideoResponse>()
{
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
}
}
};
}
/// <summary>
/// 获取图片信息
/// </summary>
/// <param name="imagePath"></param>
/// <returns></returns>
public (int width, int height) GetImageDimensions(string imagePath)
{
using (var bmp = new Bitmap(imagePath))

@ -264,6 +264,14 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
{
return await _app.GetTaskPicList(flightId, timestamp);
}
[HttpGet]
[AllowAnonymous]
public async Task<Response<CommandVideoResponse>> GetTaskVideoList(string flightId, long timestamp)
{
return await _app.GetTaskVideoList(flightId, timestamp);
}
#endregion

Loading…
Cancel
Save