Use config to store settings
This commit is contained in:
@ -5,8 +5,11 @@
|
||||
@using Hcs.Broker.MessageCapturer
|
||||
@using Hcs.Service.Async.Nsi
|
||||
@using Hcs.WebApp.Components.Shared
|
||||
@using Hcs.WebApp.Config
|
||||
@using Hcs.WebApp.Utils
|
||||
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IConfiguration Configuration
|
||||
|
||||
<PageTitle>Тестирование экспорта</PageTitle>
|
||||
|
||||
@ -62,10 +65,11 @@
|
||||
messageCapturer = new FileMessageCapturer("test/export", logger);
|
||||
messageCapturer.OnFileWritten += OnFileWritten;
|
||||
|
||||
var brokerConfig = Configuration.GetSection("BrokerConfig").Get<BrokerConfig>();
|
||||
client = new Client
|
||||
{
|
||||
OrgPPAGUID = "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
ExecutorGUID = "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
OrgPPAGUID = brokerConfig.OrgPPAGUID,
|
||||
ExecutorGUID = brokerConfig.ExecutorGUID,
|
||||
UseTunnel = false,
|
||||
IsPPAK = false,
|
||||
Role = OrganizationRole.RSO,
|
||||
@ -73,7 +77,7 @@
|
||||
MessageCapturer = messageCapturer
|
||||
};
|
||||
|
||||
client.SetSigningCertificate("0636D2330032B3C38A4A26D765C787C248");
|
||||
client.SetSigningCertificate(brokerConfig.CertificateSerialNumber);
|
||||
}
|
||||
|
||||
void OnLog(string log)
|
||||
|
||||
11
Hcs.WebApp/Config/BrokerConfig.cs
Normal file
11
Hcs.WebApp/Config/BrokerConfig.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Hcs.WebApp.Config
|
||||
{
|
||||
public class BrokerConfig
|
||||
{
|
||||
public string OrgPPAGUID { get; set; }
|
||||
|
||||
public string ExecutorGUID { get; set; }
|
||||
|
||||
public string CertificateSerialNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Hcs.WebApp
|
||||
namespace Hcs.WebApp.Utils
|
||||
{
|
||||
internal static class XmlBeautifier
|
||||
{
|
||||
@ -5,5 +5,11 @@
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
// В теории это небезопасно, но так как это чисто серверная аппка, то покс
|
||||
"BrokerConfig": {
|
||||
"OrgPPAGUID": "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
"ExecutorGUID": "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
"CertificateSerialNumber": "0636D2330032B3C38A4A26D765C787C248"
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,5 +5,11 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
// В теории это небезопасно, но так как это чисто серверная аппка, то покс
|
||||
"BrokerConfig": {
|
||||
"OrgPPAGUID": "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
"ExecutorGUID": "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||
"CertificateSerialNumber": "0636D2330032B3C38A4A26D765C787C248"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user