Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/LASAPlatform
commit
56aae9e91d
|
|
@ -4,8 +4,8 @@ using System.Drawing;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Cache;
|
||||||
using Infrastructure.CloudSdk;
|
using Infrastructure.CloudSdk;
|
||||||
using Infrastructure.CloudSdk.minio;
|
using Infrastructure.CloudSdk.minio;
|
||||||
using Infrastructure.CloudSdk.wayline;
|
using Infrastructure.CloudSdk.wayline;
|
||||||
|
|
@ -16,12 +16,9 @@ using MetadataExtractor.Formats.Exif;
|
||||||
using MetadataExtractor.Formats.Xmp;
|
using MetadataExtractor.Formats.Xmp;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
using Microsoft.Net.Http.Headers;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OpenAuth.App.BaseApp.Base;
|
using OpenAuth.App.BaseApp.Base;
|
||||||
using OpenAuth.App.BaseApp.Subscribe;
|
|
||||||
using OpenAuth.App.BasicQueryService;
|
using OpenAuth.App.BasicQueryService;
|
||||||
using OpenAuth.App.Interface;
|
using OpenAuth.App.Interface;
|
||||||
using OpenAuth.App.Request;
|
using OpenAuth.App.Request;
|
||||||
|
|
@ -50,9 +47,11 @@ namespace OpenAuth.App.ServiceApp
|
||||||
private readonly ConcurrentDictionary<string, DateTime> _processedMessages = new();
|
private readonly ConcurrentDictionary<string, DateTime> _processedMessages = new();
|
||||||
private readonly TimeSpan _deduplicationWindow = TimeSpan.FromMinutes(1);
|
private readonly TimeSpan _deduplicationWindow = TimeSpan.FromMinutes(1);
|
||||||
|
|
||||||
|
private readonly RedisCacheContext _redisCacheContext;
|
||||||
|
|
||||||
public ManageApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<LasaDronePort> repository, IAuth auth,
|
public ManageApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<LasaDronePort> repository, IAuth auth,
|
||||||
MqttClientManager mqttClientManager, CommonDataManager commonDataManager, MinioService minioService,
|
MqttClientManager mqttClientManager, CommonDataManager commonDataManager, MinioService minioService,
|
||||||
OpenJobApp openJobApp, ILogger<LasaDronePort> logger)
|
OpenJobApp openJobApp, ILogger<LasaDronePort> logger, RedisCacheContext redisCacheContext)
|
||||||
: base(unitWork, repository, auth)
|
: base(unitWork, repository, auth)
|
||||||
{
|
{
|
||||||
_mqttClientManager = mqttClientManager;
|
_mqttClientManager = mqttClientManager;
|
||||||
|
|
@ -60,6 +59,7 @@ namespace OpenAuth.App.ServiceApp
|
||||||
_commonDataManager = commonDataManager;
|
_commonDataManager = commonDataManager;
|
||||||
_openJobApp = openJobApp;
|
_openJobApp = openJobApp;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
_redisCacheContext = redisCacheContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 机场管理
|
#region 机场管理
|
||||||
|
|
@ -2936,5 +2936,28 @@ WHERE
|
||||||
Result = x
|
Result = x
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<Response<dynamic>> GetDronePortInfo(string dronePortSn)
|
||||||
|
{
|
||||||
|
var info = _redisCacheContext.Get<string>(dronePortSn);
|
||||||
|
var infoObj = JObject.Parse(info);
|
||||||
|
var modeCode = infoObj["mode_code"]?.ToString();
|
||||||
|
var droneInDock = infoObj["drone_in_dock"]?.ToString();
|
||||||
|
if (modeCode != null && droneInDock != null)
|
||||||
|
{
|
||||||
|
return new Response<dynamic>
|
||||||
|
{
|
||||||
|
Result = new
|
||||||
|
{
|
||||||
|
modeCode, droneInDock
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return new Response<dynamic>
|
||||||
|
{
|
||||||
|
Message = "查询失败",
|
||||||
|
Code = 500
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -986,5 +986,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
{
|
{
|
||||||
return await _app.ListDronePort(lng, lat);
|
return await _app.ListDronePort(lng, lat);
|
||||||
}
|
}
|
||||||
|
// todo
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<Response<dynamic>> GetDronePortInfo(string dronePortSn)
|
||||||
|
{
|
||||||
|
return await _app.GetDronePortInfo(dronePortSn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue