mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 02:17:20 +02:00
Tank info history query
This commit is contained in:
1 parent
9b9f2b141e
commit
eef4e9255b
14 files changed
+352
-32
No files matched your search
@@ -126,5 +126,41 @@ namespace WotBlitzStatisticsPro.Logic
|
||||
}
|
||||
return contextData?.Response ?? new AccountInfoHistoryResponse();
|
||||
}
|
||||
|
||||
public async Task<TankInfoHistoryResponse> GetTankInfoHistory(RealmType realm, long accountId, long tankId, DateTime startDate,
|
||||
RequestLanguage requestLanguage)
|
||||
{
|
||||
var contextData = new TankHistoryInformationContextData(startDate, tankId);
|
||||
try
|
||||
{
|
||||
var context = new OperationContext(new AccountRequest(accountId, realm, requestLanguage));
|
||||
context.AddOrReplace(contextData);
|
||||
var pipeline = new Pipeline<IOperationContext>(_operationFactory);
|
||||
|
||||
pipeline.AddOperation<ReadTankInfoFromDbOperation>()
|
||||
.AddOperation<ReadTankHistoryFromDbOperation>()
|
||||
.AddOperation<CheckIfHistoryIsEmptyOperation>()
|
||||
.AddOperation<FillOverallStatisticsOperation>()
|
||||
.AddOperation<FillPeriodStatisticsOperation>()
|
||||
.AddOperation<FillPeriodDifferenceOperation>()
|
||||
.AddOperation<FillStatisticsDifferenceOperation>()
|
||||
.AddOperation<FillTankHistoryResponseOperation>()
|
||||
;
|
||||
|
||||
var firstOperation = pipeline.Build();
|
||||
if (firstOperation != null)
|
||||
{
|
||||
await firstOperation
|
||||
.Invoke(context, null)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "GetAccountInfoHistory error");
|
||||
throw;
|
||||
}
|
||||
return contextData?.Response ?? new TankInfoHistoryResponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user