forked from ddrilling/AsbCloudServer
83 lines
3.0 KiB
C#
83 lines
3.0 KiB
C#
using AsbCloudApp.Data;
|
||
using AsbCloudApp.Data.SAUB;
|
||
using AsbCloudApp.Data.WITS;
|
||
using AsbCloudApp.Repositories;
|
||
using AsbCloudApp.Requests;
|
||
using AsbCloudApp.Services;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace AsbCloudInfrastructure.Services.SAUB;
|
||
|
||
/// <summary>
|
||
/// Сервис по работе с данными телеметрии
|
||
/// </summary>
|
||
public class TelemetryDataEditorService : ITelemetryDataEditorService
|
||
{
|
||
private readonly ITelemetryDataEditorService[] repositories;
|
||
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
/// <param name="dataSaubService"></param>
|
||
/// <param name="dataSpinService"></param>
|
||
/// <param name="dataSaubStatRepository"></param>
|
||
/// <param name="messageRepository"></param>
|
||
/// <param name="drillTestRepository"></param>
|
||
/// <param name="limitingParameterRepository"></param>
|
||
/// <param name="detectedOperationRepository"></param>
|
||
/// <param name="witsRecord1Repository"></param>
|
||
/// <param name="witsRecord7Repository"></param>
|
||
/// <param name="witsRecord8Repository"></param>
|
||
/// <param name="witsRecord50Repository"></param>
|
||
/// <param name="witsRecord60Repository"></param>
|
||
/// <param name="witsRecord61Repository"></param>
|
||
/// <param name="gtrRepository"></param>
|
||
public TelemetryDataEditorService(
|
||
ITelemetryDataSaubService dataSaubService,
|
||
ITelemetryDataService<TelemetryDataSpinDto> dataSpinService,
|
||
IDataSaubStatRepository<DataSaubStatDto> dataSaubStatRepository,
|
||
IMessageRepository messageRepository,
|
||
IDrillTestRepository drillTestRepository,
|
||
ILimitingParameterRepository limitingParameterRepository,
|
||
IDetectedOperationRepository detectedOperationRepository,
|
||
IWitsRecordRepository<Record1Dto> witsRecord1Repository,
|
||
IWitsRecordRepository<Record7Dto> witsRecord7Repository,
|
||
IWitsRecordRepository<Record8Dto> witsRecord8Repository,
|
||
IWitsRecordRepository<Record50Dto> witsRecord50Repository,
|
||
IWitsRecordRepository<Record60Dto> witsRecord60Repository,
|
||
IWitsRecordRepository<Record61Dto> witsRecord61Repository,
|
||
IGtrRepository gtrRepository
|
||
)
|
||
{
|
||
repositories =
|
||
[
|
||
dataSaubService,
|
||
dataSpinService,
|
||
dataSaubStatRepository,
|
||
messageRepository,
|
||
drillTestRepository,
|
||
limitingParameterRepository,
|
||
detectedOperationRepository,
|
||
witsRecord1Repository,
|
||
witsRecord7Repository,
|
||
witsRecord8Repository,
|
||
witsRecord50Repository,
|
||
witsRecord60Repository,
|
||
witsRecord61Repository,
|
||
gtrRepository,
|
||
];
|
||
}
|
||
|
||
public async Task<int> DeleteAsync(TelemetryPartDeleteRequest request, CancellationToken token)
|
||
{
|
||
var result = 0;
|
||
foreach (var repository in repositories)
|
||
{
|
||
result += await repository.DeleteAsync(request, token);
|
||
}
|
||
|
||
return result;
|
||
}
|
||
}
|