|
|
@@ -1,5 +1,6 @@ |
|
|
|
using BPA.ApolloClient; |
|
|
|
using BPA.Message; |
|
|
|
using BPASmartClient.Message; |
|
|
|
using BPASmartClient.Model; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using System.Xml.Linq; |
|
|
@@ -35,7 +36,6 @@ namespace BPASmartClient.Business |
|
|
|
apolloUri = System.Configuration.ConfigurationManager.AppSettings["ApolloUri"].ToString(); |
|
|
|
InternetInfo.OrderServer = System.Configuration.ConfigurationManager.AppSettings["OrderServiceUri"].ToString(); |
|
|
|
InternetInfo.StockServer = System.Configuration.ConfigurationManager.AppSettings["StockServiceUri"].ToString(); |
|
|
|
|
|
|
|
InitDeviceModel(); |
|
|
|
InitMQTT(); |
|
|
|
} |
|
|
@@ -92,7 +92,6 @@ namespace BPASmartClient.Business |
|
|
|
/// </summary> |
|
|
|
private void InitMQTT() |
|
|
|
{ |
|
|
|
|
|
|
|
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()); |
|
|
|
configurationBuilder.AddApolloConfiguration(p => |
|
|
|
{ |
|
|
@@ -103,6 +102,7 @@ namespace BPASmartClient.Business |
|
|
|
IConfiguration config = configurationBuilder.Build(); |
|
|
|
var mqttBroker = config.GetSection("BrokerHostSettings"); |
|
|
|
MQTT_Config = mqttBroker.Value.FromJSON<MQTT_Entity>(); |
|
|
|
if (MQTT_Config == null) MessageLog.GetInstance.Show("获取配置数据为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
public void Start() |
|
|
|