Add mocked broker client
This commit is contained in:
42
Hcs.Broker.Mock/Api/MockBillsApi.cs
Normal file
42
Hcs.Broker.Mock/Api/MockBillsApi.cs
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Api.Payload.Bills;
|
||||||
|
using Hcs.Service.Async.Bills;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
|
public class MockBillsApi : IBillsApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByAccountNumberAsync(short year, int month, string fiasHouseGuid, string accountNumber, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentIDAsync(string paymentDocumentID, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentNumberAsync(short year, int month, string fiasHouseGuid, string paymentDocumentNumber, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
|
public async Task<bool> ImportPaymentDocumentDataAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
Hcs.Broker.Mock/Api/MockDeviceMeteringApi.cs
Normal file
26
Hcs.Broker.Mock/Api/MockDeviceMeteringApi.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Api.Payload.DeviceMetering;
|
||||||
|
using Hcs.Service.Async.DeviceMetering;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
|
public class MockDeviceMeteringApi : IDeviceMeteringApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
|
public async Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
|
public async Task<bool> ImportMeteringDeviceValuesAsync(importMeteringDeviceValuesRequestMeteringDevicesValues values, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
114
Hcs.Broker.Mock/Api/MockHouseManagementApi.cs
Normal file
114
Hcs.Broker.Mock/Api/MockHouseManagementApi.cs
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Api.Payload.HouseManagement;
|
||||||
|
using Hcs.Service.Async.HouseManagement;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public class MockHouseManagementApi : IHouseManagementApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<IEnumerable<exportAccountResultType>> ExportAccountAsync(string fiasHouseGuid, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<IEnumerable<exportHouseResultType>> ExportHouseAsync(string fiasHouseGuid, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<IEnumerable<exportSupplyResourceContractResultType>> ExportSupplyResourceContractDataAsync(CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(string contractNumber, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<IEnumerable<exportSupplyResourceContractObjectAddressResultType>> ExportSupplyResourceContractObjectAddressDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<bool> ImportAccountDataAsync(ImportAccountDataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<importContractResultType> ImportContractDataAsync(ImportContractDataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<bool> ImportHouseUODataAsync(ImportLivingHouseUODataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<bool> ImportMeteringDeviceDataAsync(MeteringDeviceFullInformationType meteringDevice, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<bool> ImportNotificationDataAsync(ImportNotificationDataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContract> ImportSupplyResourceContractDataAsync(ImportSupplyResourceContractDataPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
|
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContractProject> ImportSupplyResourceContractProjectAsync(ImportSupplyResourceContractProjectPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Hcs.Broker.Mock/Api/MockNsiApi.cs
Normal file
17
Hcs.Broker.Mock/Api/MockNsiApi.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Service.Async.Nsi;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="INsiApi"/>
|
||||||
|
public class MockNsiApi : INsiApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="INsiApi"/>
|
||||||
|
public async Task<IEnumerable<NsiItemType>> ExportDataProviderNsiItemAsync(exportDataProviderNsiItemRequestRegistryNumber registryNumber, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker.Mock/Api/MockNsiCommonApi.cs
Normal file
25
Hcs.Broker.Mock/Api/MockNsiCommonApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Service.Async.NsiCommon;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
|
public class MockNsiCommonApi : INsiCommonApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
|
public async Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
|
public async Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker.Mock/Api/MockOrgRegistryCommonApi.cs
Normal file
25
Hcs.Broker.Mock/Api/MockOrgRegistryCommonApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Service.Async.OrgRegistryCommon;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
|
public class MockOrgRegistryCommonApi : IOrgRegistryCommonApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
|
public async Task<IEnumerable<exportDataProviderResultType>> ExportDataProviderAsync(bool isActual, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
|
public async Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker.Mock/Api/MockPaymentsApi.cs
Normal file
25
Hcs.Broker.Mock/Api/MockPaymentsApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Api.Payload.Payments;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock.Api
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
|
public class MockPaymentsApi : IPaymentsApi
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
|
public async Task<bool> ImportNotificationsOfOrderExecutionAsync(ImportNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
|
public async Task<bool> ImportSupplierNotificationsOfOrderExecutionAsync(ImportSupplierNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
await Task.Delay(3000, token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
Hcs.Broker.Mock/Hcs.Broker.Mock.csproj
Normal file
13
Hcs.Broker.Mock/Hcs.Broker.Mock.csproj
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Hcs.Broker\Hcs.Broker.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
48
Hcs.Broker.Mock/MockClient.cs
Normal file
48
Hcs.Broker.Mock/MockClient.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Logger;
|
||||||
|
using Hcs.Broker.MessageCapturer;
|
||||||
|
using Hcs.Broker.Mock.Api;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Mock
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public class MockClient : IClient
|
||||||
|
{
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public string OrgPPAGUID { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public string ExecutorGUID { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public bool UseTunnel { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public bool IsPPAK { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public OrganizationRole Role { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IClient"/>
|
||||||
|
public IMessageCapturer MessageCapturer { get; set; }
|
||||||
|
|
||||||
|
public IBillsApi Bills => new MockBillsApi();
|
||||||
|
|
||||||
|
public IDeviceMeteringApi DeviceMetering => new MockDeviceMeteringApi();
|
||||||
|
|
||||||
|
public IHouseManagementApi HouseManagement => new MockHouseManagementApi();
|
||||||
|
|
||||||
|
public INsiApi Nsi => new MockNsiApi();
|
||||||
|
|
||||||
|
public INsiCommonApi NsiCommon => new MockNsiCommonApi();
|
||||||
|
|
||||||
|
public IOrgRegistryCommonApi OrgRegistryCommon => new MockOrgRegistryCommonApi();
|
||||||
|
|
||||||
|
public IPaymentsApi Payments => new MockPaymentsApi();
|
||||||
|
|
||||||
|
public void SetSigningCertificate(string serialNumber, string? pin = null) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,58 +4,31 @@ using Hcs.Service.Async.Bills;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/BillsServiceAsync/
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
public class BillsApi(Client client) : ApiBase(client)
|
public class BillsApi(Client client) : ApiBase(client), IBillsApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
/// Экспорт платежных документов
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="paymentDocumentID">Идентификатор платежного документа</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Платежные документы</returns>
|
|
||||||
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentIDAsync(string paymentDocumentID, CancellationToken token = default)
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentIDAsync(string paymentDocumentID, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportPaymentDocumentDataRequest(client);
|
var request = new ExportPaymentDocumentDataRequest(client);
|
||||||
return await request.ExecuteByPaymentDocumentIDAsync(paymentDocumentID, token);
|
return await request.ExecuteByPaymentDocumentIDAsync(paymentDocumentID, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
/// Экспорт платежных документов
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="year">Год</param>
|
|
||||||
/// <param name="month">Месяц</param>
|
|
||||||
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
|
||||||
/// <param name="accountNumber">Номер лицевого счета/иной идентификатор плательщика</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Платежные документы</returns>
|
|
||||||
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByAccountNumberAsync(short year, int month, string fiasHouseGuid, string accountNumber, CancellationToken token = default)
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByAccountNumberAsync(short year, int month, string fiasHouseGuid, string accountNumber, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportPaymentDocumentDataRequest(client);
|
var request = new ExportPaymentDocumentDataRequest(client);
|
||||||
return await request.ExecuteByAccountNumberAsync(year, month, fiasHouseGuid, accountNumber, token);
|
return await request.ExecuteByAccountNumberAsync(year, month, fiasHouseGuid, accountNumber, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
/// Экспорт платежных документов
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="year">Год</param>
|
|
||||||
/// <param name="month">Месяц</param>
|
|
||||||
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
|
||||||
/// <param name="paymentDocumentNumber">Номер платежного документа, по которому внесена плата,
|
|
||||||
/// присвоенный такому документу исполнителем в целях осуществления расчетов по внесению платы</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Платежные документы</returns>
|
|
||||||
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentNumberAsync(short year, int month, string fiasHouseGuid, string paymentDocumentNumber, CancellationToken token = default)
|
public async Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentNumberAsync(short year, int month, string fiasHouseGuid, string paymentDocumentNumber, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportPaymentDocumentDataRequest(client);
|
var request = new ExportPaymentDocumentDataRequest(client);
|
||||||
return await request.ExecuteByPaymentDocumentNumberAsync(year, month, fiasHouseGuid, paymentDocumentNumber, token);
|
return await request.ExecuteByPaymentDocumentNumberAsync(year, month, fiasHouseGuid, paymentDocumentNumber, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IBillsApi"/>
|
||||||
/// Импорт сведений о платежных документах
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад сведений о платежных документах</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportPaymentDocumentDataAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportPaymentDocumentDataAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportPaymentDocumentDataRequest(client);
|
var request = new ImportPaymentDocumentDataRequest(client);
|
||||||
|
|||||||
@ -4,27 +4,17 @@ using Hcs.Service.Async.DeviceMetering;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/DeviceMeteringServiceAsync/
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
public class DeviceMeteringApi(Client client) : ApiBase(client)
|
public class DeviceMeteringApi(Client client) : ApiBase(client), IDeviceMeteringApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
/// Экспорт истории показаний и поверок приборов учета пользователя, установленных в указанном доме
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад выборки ПУ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Лицевые счета</returns>
|
|
||||||
public async Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default)
|
public async Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportMeteringDeviceHistoryRequest(client);
|
var request = new ExportMeteringDeviceHistoryRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IDeviceMeteringApi"/>
|
||||||
/// Импорт показаний приборов учета
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="values">Показания прибора учета</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportMeteringDeviceValuesAsync(importMeteringDeviceValuesRequestMeteringDevicesValues values, CancellationToken token = default)
|
public async Task<bool> ImportMeteringDeviceValuesAsync(importMeteringDeviceValuesRequestMeteringDevicesValues values, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportMeteringDeviceValuesRequest(client);
|
var request = new ImportMeteringDeviceValuesRequest(client);
|
||||||
|
|||||||
@ -4,158 +4,94 @@ using Hcs.Service.Async.HouseManagement;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/HouseManagementServiceAsync/
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
public class HouseManagementApi(Client client) : ApiBase(client)
|
public class HouseManagementApi(Client client) : ApiBase(client), IHouseManagementApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Экспорт лицевых счетов
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Лицевые счета</returns>
|
|
||||||
public async Task<IEnumerable<exportAccountResultType>> ExportAccountAsync(string fiasHouseGuid, CancellationToken token = default)
|
public async Task<IEnumerable<exportAccountResultType>> ExportAccountAsync(string fiasHouseGuid, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportAccountRequest(client);
|
var request = new ExportAccountRequest(client);
|
||||||
return await request.ExecuteAsync(fiasHouseGuid, token);
|
return await request.ExecuteAsync(fiasHouseGuid, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Возвращает информацию о доме
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Информация о доме</returns>
|
|
||||||
public async Task<IEnumerable<exportHouseResultType>> ExportHouseAsync(string fiasHouseGuid, CancellationToken token = default)
|
public async Task<IEnumerable<exportHouseResultType>> ExportHouseAsync(string fiasHouseGuid, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportHouseRequest(client);
|
var request = new ExportHouseRequest(client);
|
||||||
return await request.ExecuteAsync(fiasHouseGuid, token);
|
return await request.ExecuteAsync(fiasHouseGuid, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Возвращает все договора ресурсоснабжения
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Договора ресурсоснабжения</returns>
|
|
||||||
public async Task<IEnumerable<exportSupplyResourceContractResultType>> ExportSupplyResourceContractDataAsync(CancellationToken token = default)
|
public async Task<IEnumerable<exportSupplyResourceContractResultType>> ExportSupplyResourceContractDataAsync(CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportSupplyResourceContractDataRequest(client);
|
var request = new ExportSupplyResourceContractDataRequest(client);
|
||||||
return await request.ExecuteAsync(token);
|
return await request.ExecuteAsync(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Возвращает договор ресурсоснабжения по его идентификатору в ГИС ЖКХ
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractRootGuid">Идентификатор договора ресурсоснабжения в ГИС ЖКХ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Договор ресурсоснабжения</returns>
|
|
||||||
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportSupplyResourceContractDataRequest(client);
|
var request = new ExportSupplyResourceContractDataRequest(client);
|
||||||
return await request.ExecuteAsync(contractRootGuid, token);
|
return await request.ExecuteAsync(contractRootGuid, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Возвращает договор ресурсоснабжения по номеру договора в ГИС ЖКХ
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractNumber">Номер договора ресурсоснабжения в ГИС ЖКХ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Договор ресурсоснабжения</returns>
|
|
||||||
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(string contractNumber, CancellationToken token = default)
|
public async Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(string contractNumber, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportSupplyResourceContractDataRequest(client);
|
var request = new ExportSupplyResourceContractDataRequest(client);
|
||||||
return await request.ExecuteAsync(contractNumber, token);
|
return await request.ExecuteAsync(contractNumber, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Возвращает объекты жилищного фонда из договора ресурсоснабжения по его идентификатору
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractRootGuid">Идентификатор договора ресурсоснабжения в ГИС ЖКХ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Объекты жилищного фонда</returns>
|
|
||||||
public async Task<IEnumerable<exportSupplyResourceContractObjectAddressResultType>> ExportSupplyResourceContractObjectAddressDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
public async Task<IEnumerable<exportSupplyResourceContractObjectAddressResultType>> ExportSupplyResourceContractObjectAddressDataAsync(Guid contractRootGuid, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ExportSupplyResourceContractObjectAddressDataRequest(client);
|
var request = new ExportSupplyResourceContractObjectAddressDataRequest(client);
|
||||||
return await request.ExecuteAsync(contractRootGuid, token);
|
return await request.ExecuteAsync(contractRootGuid, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт лицевого счета
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад лицевого счета</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportAccountDataAsync(ImportAccountDataPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportAccountDataAsync(ImportAccountDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportAccountDataRequest(client);
|
var request = new ImportAccountDataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт сведений о ДУ (создание ДУ)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад ДУ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Импортированный договор</returns>
|
|
||||||
public async Task<importContractResultType> ImportContractDataAsync(ImportContractDataPayload payload, CancellationToken token = default)
|
public async Task<importContractResultType> ImportContractDataAsync(ImportContractDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportContractDataRequest(client);
|
var request = new ImportContractDataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт данных дома
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад данных дома</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportHouseUODataAsync(ImportLivingHouseUODataPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportHouseUODataAsync(ImportLivingHouseUODataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportHouseUODataRequest(client);
|
var request = new ImportHouseUODataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт прибора учета
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="meteringDevice">Прибор учета</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportMeteringDeviceDataAsync(MeteringDeviceFullInformationType meteringDevice, CancellationToken token = default)
|
public async Task<bool> ImportMeteringDeviceDataAsync(MeteringDeviceFullInformationType meteringDevice, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportMeteringDeviceDataRequest(client);
|
var request = new ImportMeteringDeviceDataRequest(client);
|
||||||
return await request.ExecuteAsync(meteringDevice, token);
|
return await request.ExecuteAsync(meteringDevice, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт новости для информирования граждан
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад новости</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportNotificationDataAsync(ImportNotificationDataPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportNotificationDataAsync(ImportNotificationDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportNotificationDataRequest(client);
|
var request = new ImportNotificationDataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт договора ресурсоснабжения с РСО
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад договора ресурсоснабжения</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Импортированный договор</returns>
|
|
||||||
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContract> ImportSupplyResourceContractDataAsync(ImportSupplyResourceContractDataPayload payload, CancellationToken token = default)
|
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContract> ImportSupplyResourceContractDataAsync(ImportSupplyResourceContractDataPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportSupplyResourceContractDataRequest(client);
|
var request = new ImportSupplyResourceContractDataRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IHouseManagementApi"/>
|
||||||
/// Импорт проекта договора ресурсоснабжения с РСО
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад проекта договора ресурсоснабжения</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Импортированный проект договора</returns>
|
|
||||||
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContractProject> ImportSupplyResourceContractProjectAsync(ImportSupplyResourceContractProjectPayload payload, CancellationToken token = default)
|
public async Task<getStateResultImportResultCommonResultImportSupplyResourceContractProject> ImportSupplyResourceContractProjectAsync(ImportSupplyResourceContractProjectPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportSupplyResourceContractProjectRequest(client);
|
var request = new ImportSupplyResourceContractProjectRequest(client);
|
||||||
|
|||||||
48
Hcs.Broker/Api/IBillsApi.cs
Normal file
48
Hcs.Broker/Api/IBillsApi.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using Hcs.Broker.Api.Payload.Bills;
|
||||||
|
using Hcs.Service.Async.Bills;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/BillsServiceAsync/
|
||||||
|
public interface IBillsApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт платежных документов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paymentDocumentID">Идентификатор платежного документа</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Платежные документы</returns>
|
||||||
|
Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentIDAsync(string paymentDocumentID, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт платежных документов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="year">Год</param>
|
||||||
|
/// <param name="month">Месяц</param>
|
||||||
|
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
||||||
|
/// <param name="accountNumber">Номер лицевого счета/иной идентификатор плательщика</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Платежные документы</returns>
|
||||||
|
Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByAccountNumberAsync(short year, int month, string fiasHouseGuid, string accountNumber, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт платежных документов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="year">Год</param>
|
||||||
|
/// <param name="month">Месяц</param>
|
||||||
|
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
||||||
|
/// <param name="paymentDocumentNumber">Номер платежного документа, по которому внесена плата,
|
||||||
|
/// присвоенный такому документу исполнителем в целях осуществления расчетов по внесению платы</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Платежные документы</returns>
|
||||||
|
Task<IEnumerable<exportPaymentDocumentResultType>> ExportPaymentDocumentDataByPaymentDocumentNumberAsync(short year, int month, string fiasHouseGuid, string paymentDocumentNumber, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт сведений о платежных документах
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад сведений о платежных документах</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportPaymentDocumentDataAsync(ImportPaymentDocumentDataPayload payload, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker/Api/IDeviceMeteringApi.cs
Normal file
25
Hcs.Broker/Api/IDeviceMeteringApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Broker.Api.Payload.DeviceMetering;
|
||||||
|
using Hcs.Service.Async.DeviceMetering;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/DeviceMeteringServiceAsync/
|
||||||
|
public interface IDeviceMeteringApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт истории показаний и поверок приборов учета пользователя, установленных в указанном доме
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад выборки ПУ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Лицевые счета</returns>
|
||||||
|
Task<IEnumerable<exportMeteringDeviceHistoryResultType>> ExportMeteringDeviceHistoryAsync(ExportMeteringDeviceHistoryPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт показаний приборов учета
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="values">Показания прибора учета</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportMeteringDeviceValuesAsync(importMeteringDeviceValuesRequestMeteringDevicesValues values, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
112
Hcs.Broker/Api/IHouseManagementApi.cs
Normal file
112
Hcs.Broker/Api/IHouseManagementApi.cs
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
using Hcs.Broker.Api.Payload.HouseManagement;
|
||||||
|
using Hcs.Service.Async.HouseManagement;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/HouseManagementServiceAsync/
|
||||||
|
public interface IHouseManagementApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт лицевых счетов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Лицевые счета</returns>
|
||||||
|
Task<IEnumerable<exportAccountResultType>> ExportAccountAsync(string fiasHouseGuid, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает информацию о доме
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fiasHouseGuid">Глобальный уникальный идентификатор дома по ФИАС</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Информация о доме</returns>
|
||||||
|
Task<IEnumerable<exportHouseResultType>> ExportHouseAsync(string fiasHouseGuid, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает все договора ресурсоснабжения
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Договора ресурсоснабжения</returns>
|
||||||
|
Task<IEnumerable<exportSupplyResourceContractResultType>> ExportSupplyResourceContractDataAsync(CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает договор ресурсоснабжения по его идентификатору в ГИС ЖКХ
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="contractRootGuid">Идентификатор договора ресурсоснабжения в ГИС ЖКХ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Договор ресурсоснабжения</returns>
|
||||||
|
Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(Guid contractRootGuid, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает договор ресурсоснабжения по номеру договора в ГИС ЖКХ
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="contractNumber">Номер договора ресурсоснабжения в ГИС ЖКХ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Договор ресурсоснабжения</returns>
|
||||||
|
Task<exportSupplyResourceContractResultType> ExportSupplyResourceContractDataAsync(string contractNumber, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает объекты жилищного фонда из договора ресурсоснабжения по его идентификатору
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="contractRootGuid">Идентификатор договора ресурсоснабжения в ГИС ЖКХ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Объекты жилищного фонда</returns>
|
||||||
|
Task<IEnumerable<exportSupplyResourceContractObjectAddressResultType>> ExportSupplyResourceContractObjectAddressDataAsync(Guid contractRootGuid, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт лицевого счета
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад лицевого счета</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportAccountDataAsync(ImportAccountDataPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт сведений о ДУ (создание ДУ)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад ДУ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Импортированный договор</returns>
|
||||||
|
Task<importContractResultType> ImportContractDataAsync(ImportContractDataPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт данных дома
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад данных дома</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportHouseUODataAsync(ImportLivingHouseUODataPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт прибора учета
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="meteringDevice">Прибор учета</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportMeteringDeviceDataAsync(MeteringDeviceFullInformationType meteringDevice, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт новости для информирования граждан
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад новости</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportNotificationDataAsync(ImportNotificationDataPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт договора ресурсоснабжения с РСО
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад договора ресурсоснабжения</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Импортированный договор</returns>
|
||||||
|
Task<getStateResultImportResultCommonResultImportSupplyResourceContract> ImportSupplyResourceContractDataAsync(ImportSupplyResourceContractDataPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт проекта договора ресурсоснабжения с РСО
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад проекта договора ресурсоснабжения</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Импортированный проект договора</returns>
|
||||||
|
Task<getStateResultImportResultCommonResultImportSupplyResourceContractProject> ImportSupplyResourceContractProjectAsync(ImportSupplyResourceContractProjectPayload payload, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Hcs.Broker/Api/INsiApi.cs
Normal file
16
Hcs.Broker/Api/INsiApi.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Hcs.Service.Async.Nsi;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/NsiService/
|
||||||
|
public interface INsiApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает данные справочника поставщика информации
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="registryNumber">Реестровый номер справочника</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Данные справочника</returns>
|
||||||
|
Task<IEnumerable<NsiItemType>> ExportDataProviderNsiItemAsync(exportDataProviderNsiItemRequestRegistryNumber registryNumber, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker/Api/INsiCommonApi.cs
Normal file
25
Hcs.Broker/Api/INsiCommonApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Service.Async.NsiCommon;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/NsiCommonService/
|
||||||
|
public interface INsiCommonApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает данные общесистемного справочника
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="registryNumber">Реестровый номер справочника</param>
|
||||||
|
/// <param name="listGroup">Группа справочников, где NSI - общесистемный, а NSIRAO - ОЖФ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Данные общесистемного справочника</returns>
|
||||||
|
Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает перечень общесистемных справочников с указанием даты последнего изменения каждого из них
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="listGroup">Группа справочников, где NSI - общесистемный, а NSIRAO - ОЖФ</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Перечень общесистемных справочников</returns>
|
||||||
|
Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Hcs.Broker/Api/IOrgRegistryCommonApi.cs
Normal file
25
Hcs.Broker/Api/IOrgRegistryCommonApi.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using Hcs.Service.Async.OrgRegistryCommon;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/OrganizationsRegistryCommonAsyncService/
|
||||||
|
public interface IOrgRegistryCommonApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт сведений о поставщиках информации ИС
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isActual">Выгрузить только активных поставщиков данных</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Сведения о поставщиках данных</returns>
|
||||||
|
Task<IEnumerable<exportDataProviderResultType>> ExportDataProviderAsync(bool isActual, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Экспорт сведений из реестра организаций
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ogrn">ОГРН</param>
|
||||||
|
/// <param name="kpp">КПП</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>Сведения из реестра организаций</returns>
|
||||||
|
Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
Hcs.Broker/Api/IPaymentsApi.cs
Normal file
24
Hcs.Broker/Api/IPaymentsApi.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using Hcs.Broker.Api.Payload.Payments;
|
||||||
|
|
||||||
|
namespace Hcs.Broker.Api
|
||||||
|
{
|
||||||
|
// http://open-gkh.ru/PaymentsServiceAsync/
|
||||||
|
public interface IPaymentsApi
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ВИ_ОПЛАТА_ИЗВ. Передать перечень документов "Извещение о принятии к исполнению распоряжения".
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад документа</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportNotificationsOfOrderExecutionAsync(ImportNotificationsOfOrderExecutionPayload payload, CancellationToken token = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Импорт пакета документов "Извещение о принятии к исполнению распоряжения", размещаемых исполнителем
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="payload">Пейлоад документа</param>
|
||||||
|
/// <param name="token">Токен отмены</param>
|
||||||
|
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
||||||
|
Task<bool> ImportSupplierNotificationsOfOrderExecutionAsync(ImportSupplierNotificationsOfOrderExecutionPayload payload, CancellationToken token = default);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,15 +4,10 @@ using Hcs.Service.Async.Nsi;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/NsiService/
|
/// <inheritdoc cref="INsiApi"/>
|
||||||
public class NsiApi(Client client) : ApiBase(client)
|
public class NsiApi(Client client) : ApiBase(client), INsiApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="INsiApi"/>
|
||||||
/// Возвращает данные справочника поставщика информации
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="registryNumber">Реестровый номер справочника</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Данные справочника</returns>
|
|
||||||
public async Task<IEnumerable<NsiItemType>> ExportDataProviderNsiItemAsync(exportDataProviderNsiItemRequestRegistryNumber registryNumber, CancellationToken token = default)
|
public async Task<IEnumerable<NsiItemType>> ExportDataProviderNsiItemAsync(exportDataProviderNsiItemRequestRegistryNumber registryNumber, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -4,16 +4,10 @@ using Hcs.Service.Async.NsiCommon;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/NsiCommonService/
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
public class NsiCommonApi(Client client) : ApiBase(client)
|
public class NsiCommonApi(Client client) : ApiBase(client), INsiCommonApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
/// Возвращает данные общесистемного справочника
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="registryNumber">Реестровый номер справочника</param>
|
|
||||||
/// <param name="listGroup">Группа справочников, где NSI - общесистемный, а NSIRAO - ОЖФ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Данные общесистемного справочника</returns>
|
|
||||||
public async Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
|
public async Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -27,12 +21,7 @@ namespace Hcs.Broker.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="INsiCommonApi"/>
|
||||||
/// Возвращает перечень общесистемных справочников с указанием даты последнего изменения каждого из них
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="listGroup">Группа справочников, где NSI - общесистемный, а NSIRAO - ОЖФ</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Перечень общесистемных справочников</returns>
|
|
||||||
public async Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default)
|
public async Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -4,15 +4,10 @@ using Hcs.Service.Async.OrgRegistryCommon;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/OrganizationsRegistryCommonAsyncService/
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
public class OrgRegistryCommonApi(Client client) : ApiBase(client)
|
public class OrgRegistryCommonApi(Client client) : ApiBase(client), IOrgRegistryCommonApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
/// Экспорт сведений о поставщиках информации ИС
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="isActual">Выгрузить только активных поставщиков данных</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Сведения о поставщиках данных</returns>
|
|
||||||
public async Task<IEnumerable<exportDataProviderResultType>> ExportDataProviderAsync(bool isActual, CancellationToken token = default)
|
public async Task<IEnumerable<exportDataProviderResultType>> ExportDataProviderAsync(bool isActual, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -26,13 +21,7 @@ namespace Hcs.Broker.Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IOrgRegistryCommonApi"/>
|
||||||
/// Экспорт сведений из реестра организаций
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ogrn">ОГРН</param>
|
|
||||||
/// <param name="kpp">КПП</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>Сведения из реестра организаций</returns>
|
|
||||||
public async Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default)
|
public async Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -3,27 +3,17 @@ using Hcs.Broker.Api.Request.Payments;
|
|||||||
|
|
||||||
namespace Hcs.Broker.Api
|
namespace Hcs.Broker.Api
|
||||||
{
|
{
|
||||||
// http://open-gkh.ru/PaymentsServiceAsync/
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
public class PaymentsApi(Client client) : ApiBase(client)
|
public class PaymentsApi(Client client) : ApiBase(client), IPaymentsApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
/// ВИ_ОПЛАТА_ИЗВ. Передать перечень документов "Извещение о принятии к исполнению распоряжения".
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад документа</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportNotificationsOfOrderExecutionAsync(ImportNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportNotificationsOfOrderExecutionAsync(ImportNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportNotificationsOfOrderExecutionRequest(client);
|
var request = new ImportNotificationsOfOrderExecutionRequest(client);
|
||||||
return await request.ExecuteAsync(payload, token);
|
return await request.ExecuteAsync(payload, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IPaymentsApi"/>
|
||||||
/// Импорт пакета документов "Извещение о принятии к исполнению распоряжения", размещаемых исполнителем
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="payload">Пейлоад документа</param>
|
|
||||||
/// <param name="token">Токен отмены</param>
|
|
||||||
/// <returns>true, если операция выполнена успешно, иначе - false</returns>
|
|
||||||
public async Task<bool> ImportSupplierNotificationsOfOrderExecutionAsync(ImportSupplierNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
public async Task<bool> ImportSupplierNotificationsOfOrderExecutionAsync(ImportSupplierNotificationsOfOrderExecutionPayload payload, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
var request = new ImportSupplierNotificationsOfOrderExecutionRequest(client);
|
var request = new ImportSupplierNotificationsOfOrderExecutionRequest(client);
|
||||||
|
|||||||
@ -8,60 +8,43 @@ using System.Security.Cryptography.X509Certificates;
|
|||||||
|
|
||||||
namespace Hcs.Broker
|
namespace Hcs.Broker
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Клиент для вызова всех реализованных функций интеграции с ГИС ЖКХ
|
public class Client : IClient
|
||||||
/// </summary>
|
|
||||||
public class Client
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Идентификатор поставщика данных ГИС ЖКХ
|
|
||||||
/// </summary>
|
|
||||||
public string OrgPPAGUID { get; set; }
|
public string OrgPPAGUID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Исполнитель/сотрудник ГИС ЖКХ, от которого будут регистрироваться ответы
|
|
||||||
/// </summary>
|
|
||||||
public string ExecutorGUID { get; set; }
|
public string ExecutorGUID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Признак, указывающий на то, что используется ли внешний туннель (stunnel)
|
|
||||||
/// </summary>
|
|
||||||
public bool UseTunnel { get; set; }
|
public bool UseTunnel { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Если true, то запросы будут выполняться на промышленном стенде, иначе - на тестовом
|
|
||||||
/// </summary>
|
|
||||||
public bool IsPPAK { get; set; }
|
public bool IsPPAK { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Роль
|
|
||||||
/// </summary>
|
|
||||||
public OrganizationRole Role { get; set; }
|
public OrganizationRole Role { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Устанавливаемый пользователем приемник отладочных сообщений
|
|
||||||
/// </summary>
|
|
||||||
public ILogger Logger { get; set; }
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <inheritdoc cref="IClient"/>
|
||||||
/// Устанавливаемый пользователем механизм перехвата содержимого отправляемых
|
|
||||||
/// и принимаемых пакетов
|
|
||||||
/// </summary>
|
|
||||||
public IMessageCapturer MessageCapturer { get; set; }
|
public IMessageCapturer MessageCapturer { get; set; }
|
||||||
|
|
||||||
public BillsApi Bills => new(this);
|
public IBillsApi Bills => new BillsApi(this);
|
||||||
|
|
||||||
public DeviceMeteringApi DeviceMetering => new(this);
|
public IDeviceMeteringApi DeviceMetering => new DeviceMeteringApi(this);
|
||||||
|
|
||||||
public HouseManagementApi HouseManagement => new(this);
|
public IHouseManagementApi HouseManagement => new HouseManagementApi(this);
|
||||||
|
|
||||||
public NsiApi Nsi => new(this);
|
public INsiApi Nsi => new NsiApi(this);
|
||||||
|
|
||||||
public NsiCommonApi NsiCommon => new(this);
|
public INsiCommonApi NsiCommon => new NsiCommonApi(this);
|
||||||
|
|
||||||
public OrgRegistryCommonApi OrgRegistryCommon => new(this);
|
public IOrgRegistryCommonApi OrgRegistryCommon => new OrgRegistryCommonApi(this);
|
||||||
|
|
||||||
public PaymentsApi Payments => new(this);
|
public IPaymentsApi Payments => new PaymentsApi(this);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Сертификат клиента для применения при формировании запросов
|
/// Сертификат клиента для применения при формировании запросов
|
||||||
|
|||||||
64
Hcs.Broker/IClient.cs
Normal file
64
Hcs.Broker/IClient.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using Hcs.Broker.Api;
|
||||||
|
using Hcs.Broker.Logger;
|
||||||
|
using Hcs.Broker.MessageCapturer;
|
||||||
|
|
||||||
|
namespace Hcs.Broker
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Клиент для вызова всех реализованных функций интеграции с ГИС ЖКХ
|
||||||
|
/// </summary>
|
||||||
|
public interface IClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор поставщика данных ГИС ЖКХ
|
||||||
|
/// </summary>
|
||||||
|
string OrgPPAGUID { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Исполнитель/сотрудник ГИС ЖКХ, от которого будут регистрироваться ответы
|
||||||
|
/// </summary>
|
||||||
|
string ExecutorGUID { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Признак, указывающий на то, что используется ли внешний туннель (stunnel)
|
||||||
|
/// </summary>
|
||||||
|
bool UseTunnel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Если true, то запросы будут выполняться на промышленном стенде, иначе - на тестовом
|
||||||
|
/// </summary>
|
||||||
|
bool IsPPAK { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Роль
|
||||||
|
/// </summary>
|
||||||
|
OrganizationRole Role { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Устанавливаемый пользователем приемник отладочных сообщений
|
||||||
|
/// </summary>
|
||||||
|
ILogger Logger { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Устанавливаемый пользователем механизм перехвата содержимого отправляемых
|
||||||
|
/// и принимаемых пакетов
|
||||||
|
/// </summary>
|
||||||
|
IMessageCapturer MessageCapturer { get; set; }
|
||||||
|
|
||||||
|
IBillsApi Bills { get; }
|
||||||
|
|
||||||
|
IDeviceMeteringApi DeviceMetering { get; }
|
||||||
|
|
||||||
|
IHouseManagementApi HouseManagement { get; }
|
||||||
|
|
||||||
|
INsiApi Nsi { get; }
|
||||||
|
|
||||||
|
INsiCommonApi NsiCommon { get; }
|
||||||
|
|
||||||
|
IOrgRegistryCommonApi OrgRegistryCommon { get; }
|
||||||
|
|
||||||
|
IPaymentsApi Payments { get; }
|
||||||
|
|
||||||
|
void SetSigningCertificate(string serialNumber, string? pin = null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@
|
|||||||
@using Hcs.Broker.MessageCapturer
|
@using Hcs.Broker.MessageCapturer
|
||||||
@using Hcs.Service.Async.Nsi
|
@using Hcs.Service.Async.Nsi
|
||||||
@using Hcs.WebApp.Config
|
@using Hcs.WebApp.Config
|
||||||
|
@using Hcs.WebApp.Services
|
||||||
@using Hcs.WebApp.Utils
|
@using Hcs.WebApp.Utils
|
||||||
@using Microsoft.AspNetCore.Authorization
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
|
||||||
@ -14,6 +15,7 @@
|
|||||||
|
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject IConfiguration Configuration
|
@inject IConfiguration Configuration
|
||||||
|
@inject IClientProvider ClientProvider
|
||||||
|
|
||||||
<PageTitle>Тестирование экспорта</PageTitle>
|
<PageTitle>Тестирование экспорта</PageTitle>
|
||||||
|
|
||||||
@ -59,7 +61,7 @@
|
|||||||
string messageBody;
|
string messageBody;
|
||||||
string responseBody;
|
string responseBody;
|
||||||
|
|
||||||
Client client;
|
IClient client;
|
||||||
ActionLogger logger = new ActionLogger();
|
ActionLogger logger = new ActionLogger();
|
||||||
FileMessageCapturer messageCapturer;
|
FileMessageCapturer messageCapturer;
|
||||||
bool catchMessageBody;
|
bool catchMessageBody;
|
||||||
@ -73,19 +75,8 @@
|
|||||||
messageCapturer = new FileMessageCapturer("test/export", logger);
|
messageCapturer = new FileMessageCapturer("test/export", logger);
|
||||||
messageCapturer.OnFileWritten += OnFileWritten;
|
messageCapturer.OnFileWritten += OnFileWritten;
|
||||||
|
|
||||||
var brokerConfig = Configuration.GetSection("BrokerConfig").Get<BrokerConfig>();
|
var config = Configuration.GetSection("BrokerConfig").Get<BrokerConfig>();
|
||||||
client = new Client
|
client = ClientProvider.CreateClient(config, logger, messageCapturer);
|
||||||
{
|
|
||||||
OrgPPAGUID = brokerConfig.OrgPPAGUID,
|
|
||||||
ExecutorGUID = brokerConfig.ExecutorGUID,
|
|
||||||
UseTunnel = false,
|
|
||||||
IsPPAK = false,
|
|
||||||
Role = OrganizationRole.RSO,
|
|
||||||
Logger = logger,
|
|
||||||
MessageCapturer = messageCapturer
|
|
||||||
};
|
|
||||||
|
|
||||||
client.SetSigningCertificate(brokerConfig.CertificateSerialNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|||||||
@ -6,6 +6,10 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
<DefineConstants>$(DefineConstants);USE_MOCK</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.20" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.20" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="8.0.20" />
|
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="8.0.20" />
|
||||||
@ -25,6 +29,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Hcs.Broker.Mock\Hcs.Broker.Mock.csproj" />
|
||||||
<ProjectReference Include="..\Hcs.Broker\Hcs.Broker.csproj" />
|
<ProjectReference Include="..\Hcs.Broker\Hcs.Broker.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using Hcs.WebApp.Components;
|
using Hcs.WebApp.Components;
|
||||||
using Hcs.WebApp.Data;
|
using Hcs.WebApp.Data;
|
||||||
|
using Hcs.WebApp.Services;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Radzen;
|
using Radzen;
|
||||||
@ -34,6 +35,12 @@ builder.Services
|
|||||||
.AddEntityFrameworkStores<AppIdentityDbContext>()
|
.AddEntityFrameworkStores<AppIdentityDbContext>()
|
||||||
.AddDefaultTokenProviders();
|
.AddDefaultTokenProviders();
|
||||||
|
|
||||||
|
#if USE_MOCK
|
||||||
|
builder.Services.AddTransient<IClientProvider, MockClientProvider>();
|
||||||
|
#else
|
||||||
|
builder.Services.AddTransient<IClientProvider, ClientProvider>();
|
||||||
|
#endif
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
|
|||||||
27
Hcs.WebApp/Services/ClientProvider.cs
Normal file
27
Hcs.WebApp/Services/ClientProvider.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using Hcs.Broker;
|
||||||
|
using Hcs.Broker.MessageCapturer;
|
||||||
|
using Hcs.WebApp.Config;
|
||||||
|
|
||||||
|
namespace Hcs.WebApp.Services
|
||||||
|
{
|
||||||
|
public class ClientProvider : IClientProvider
|
||||||
|
{
|
||||||
|
public IClient CreateClient(BrokerConfig config, Broker.Logger.ILogger logger, IMessageCapturer messageCapturer)
|
||||||
|
{
|
||||||
|
var client = new Client
|
||||||
|
{
|
||||||
|
OrgPPAGUID = config.OrgPPAGUID,
|
||||||
|
ExecutorGUID = config.ExecutorGUID,
|
||||||
|
UseTunnel = false,
|
||||||
|
IsPPAK = false,
|
||||||
|
Role = OrganizationRole.RSO,
|
||||||
|
Logger = logger,
|
||||||
|
MessageCapturer = messageCapturer
|
||||||
|
};
|
||||||
|
|
||||||
|
client.SetSigningCertificate(config.CertificateSerialNumber);
|
||||||
|
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Hcs.WebApp/Services/IClientProvider.cs
Normal file
11
Hcs.WebApp/Services/IClientProvider.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using Hcs.Broker;
|
||||||
|
using Hcs.Broker.MessageCapturer;
|
||||||
|
using Hcs.WebApp.Config;
|
||||||
|
|
||||||
|
namespace Hcs.WebApp.Services
|
||||||
|
{
|
||||||
|
public interface IClientProvider
|
||||||
|
{
|
||||||
|
IClient CreateClient(BrokerConfig config, Broker.Logger.ILogger logger, IMessageCapturer messageCapturer);
|
||||||
|
}
|
||||||
|
}
|
||||||
19
Hcs.WebApp/Services/MockClientProvider.cs
Normal file
19
Hcs.WebApp/Services/MockClientProvider.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using Hcs.Broker;
|
||||||
|
using Hcs.Broker.MessageCapturer;
|
||||||
|
using Hcs.Broker.Mock;
|
||||||
|
using Hcs.WebApp.Config;
|
||||||
|
|
||||||
|
namespace Hcs.WebApp.Services
|
||||||
|
{
|
||||||
|
public class MockClientProvider : IClientProvider
|
||||||
|
{
|
||||||
|
public IClient CreateClient(BrokerConfig config, Broker.Logger.ILogger logger, IMessageCapturer messageCapturer)
|
||||||
|
{
|
||||||
|
#if USE_MOCK
|
||||||
|
return new MockClient();
|
||||||
|
#else
|
||||||
|
return null;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
Hcs.sln
5
Hcs.sln
@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hcs.WebApp", "Hcs.WebApp\Hc
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hcs.Broker", "Hcs.Broker\Hcs.Broker.csproj", "{F1A3A447-79C9-4387-88AF-981F5BC3BA88}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hcs.Broker", "Hcs.Broker\Hcs.Broker.csproj", "{F1A3A447-79C9-4387-88AF-981F5BC3BA88}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hcs.Broker.Mock", "Hcs.Broker.Mock\Hcs.Broker.Mock.csproj", "{D28CCA2E-10F1-411E-A103-F6BCB4D1BCAF}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -33,6 +35,9 @@ Global
|
|||||||
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Release|Any CPU.Build.0 = Release|Any CPU
|
{F1A3A447-79C9-4387-88AF-981F5BC3BA88}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D28CCA2E-10F1-411E-A103-F6BCB4D1BCAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D28CCA2E-10F1-411E-A103-F6BCB4D1BCAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D28CCA2E-10F1-411E-A103-F6BCB4D1BCAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user