|
|
|
|
@ -25,6 +25,7 @@ using Infrastructure.Extensions;
|
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
using System.Text.Json.Nodes;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using OpenAuth.WebApi;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App.ServiceApp.DroneDocking
|
|
|
|
|
@ -35,12 +36,14 @@ namespace OpenAuth.App.ServiceApp.DroneDocking
|
|
|
|
|
private IConfiguration configuration;
|
|
|
|
|
private readonly ISqlSugarClient _client;
|
|
|
|
|
private readonly MinioService _minioService;
|
|
|
|
|
public DroneDockApp(EncryptionHelper helper, IConfiguration configuration, ISqlSugarClient client, MinioService minioService, ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<DroneDocktask> repository, IAuth auth) : base(unitWork, repository, auth)
|
|
|
|
|
private readonly MqttClientManager _mqttClientManager;
|
|
|
|
|
public DroneDockApp(EncryptionHelper helper, IConfiguration configuration, ISqlSugarClient client, MinioService minioService, MqttClientManager mqttClientManager, ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<DroneDocktask> repository, IAuth auth) : base(unitWork, repository, auth)
|
|
|
|
|
{
|
|
|
|
|
_helper = helper;
|
|
|
|
|
this.configuration = configuration;
|
|
|
|
|
_client = client;
|
|
|
|
|
_minioService = minioService;
|
|
|
|
|
_mqttClientManager = mqttClientManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -648,6 +651,14 @@ namespace OpenAuth.App.ServiceApp.DroneDocking
|
|
|
|
|
ResData Response = new ResData();
|
|
|
|
|
string data = "{\r\n\"code\": 200,\r\n\"data\": {\r\n\"mode_code\":0,\r\n\"longitude\":122.45,\r\n\"latitude\":30.45,\r\n\"height\":80,\r\n\"elevation\":50,\r\n\"gimbal_pitch\":-45,\r\n\"gimbal_yaw\":23,\r\n\"battery_capacity_percent\":35,\r\n\"gps_state\":2,\r\n},\r\n\"message\": \"获取无人机机场状态成功!\",\r\n\"traceid\": \"xxx\"\r\n}";
|
|
|
|
|
//todo deviceid
|
|
|
|
|
var topicRequest1 = $"thing/product/" + deviceid + "/osd";
|
|
|
|
|
await _mqttClientManager.SubscribeAsync(topicRequest1, async (args) =>
|
|
|
|
|
{
|
|
|
|
|
var payload1 = args.ApplicationMessage.Payload;
|
|
|
|
|
var message = Encoding.UTF8.GetString(payload1);
|
|
|
|
|
Console.WriteLine($"收到主题 [{args.ApplicationMessage.Topic}] 的消息: {message}");
|
|
|
|
|
await Task.CompletedTask;
|
|
|
|
|
});
|
|
|
|
|
if (true)
|
|
|
|
|
{
|
|
|
|
|
string x_lc_secret = _helper.getxseret();
|
|
|
|
|
|