机场注册获取配置
parent
06277e6a5d
commit
c8b6adefda
|
|
@ -14,13 +14,16 @@ using DocumentFormat.OpenXml.EMMA;
|
|||
using NPOI.SS.Formula.Functions;
|
||||
using Infrastructure.Extensions;
|
||||
using DocumentFormat.OpenXml.Math;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace OpenAuth.App.ServiceApp
|
||||
{
|
||||
public class AirportMaintenanceApp : SqlSugarBaseApp<LasaDronePort, SugarDbContext>
|
||||
{
|
||||
public AirportMaintenanceApp(ISugarUnitOfWork<SugarDbContext> unitWork, ISimpleClient<LasaDronePort> repository, IAuth auth) : base(unitWork, repository, auth)
|
||||
private readonly IConfiguration _configuration;
|
||||
public AirportMaintenanceApp(ISugarUnitOfWork<SugarDbContext> unitWork, IConfiguration configuration, ISimpleClient<LasaDronePort> repository, IAuth auth) : base(unitWork, repository, auth)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
//获取设备绑定码
|
||||
public async Task<Response<LasaDeviceBindingCode>> GetDeviceBindingCode()
|
||||
|
|
@ -113,15 +116,19 @@ namespace OpenAuth.App.ServiceApp
|
|||
}
|
||||
else
|
||||
{
|
||||
var serverIp = _configuration.GetSection("MQTT:Server").Value;
|
||||
var port = _configuration.GetSection("MQTT:Port").Value;
|
||||
var username = _configuration.GetSection("MQTT:UserName").Value;
|
||||
var password = _configuration.GetSection("MQTT:Password").Value;
|
||||
//如果网关不存在,则创建一个新的
|
||||
var newGateway = new LasaGateway
|
||||
{
|
||||
Id = Guid.NewGuid().ToString(),
|
||||
CreateTime = DateTime.Now,
|
||||
GatewayAccount = "sdhc",
|
||||
GatewayAccount = username,
|
||||
GatewaySn = Guid.NewGuid().ToString("N").Substring(0, 8).ToUpper(), // 生成一个新的
|
||||
MqttGateway = "175.27.168.120:6011",
|
||||
MqttPassword = "",
|
||||
MqttGateway = serverIp + ":" + port,
|
||||
MqttPassword = password,
|
||||
OrgId = "371300", // 默认组织ID
|
||||
BindStatus = 0 // 未绑定状态
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue