mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 02:17:20 +02:00
Preparing for the History query
This commit is contained in:
1 parent
ddbf42e7bb
commit
ed52a65788
14 files changed
+334
-6
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline
|
||||
{
|
||||
public class AccountInformationPipelineContext
|
||||
public class AccountInformationPipelineContext: IDatabasePipelineContext
|
||||
{
|
||||
public AccountInformationPipelineContext(
|
||||
long accountId,
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline
|
||||
{
|
||||
public class HistoryInformationPipelineContext: IDatabasePipelineContext
|
||||
{
|
||||
public HistoryInformationPipelineContext(
|
||||
long accountId,
|
||||
RealmType realmType,
|
||||
RequestLanguage requestLanguage)
|
||||
{
|
||||
AccountId = accountId;
|
||||
RealmType = realmType;
|
||||
RequestLanguage = requestLanguage;
|
||||
}
|
||||
|
||||
|
||||
public long AccountId { get; }
|
||||
public RealmType RealmType { get; }
|
||||
public RequestLanguage RequestLanguage { get; }
|
||||
|
||||
public AccountInfo DbAccountInfo { get; set; }
|
||||
|
||||
|
||||
public AccountInfoHistoryResponse Response { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline
|
||||
{
|
||||
public interface IAccountPipelineContext
|
||||
{
|
||||
long AccountId { get; }
|
||||
RealmType RealmType { get; }
|
||||
RequestLanguage RequestLanguage { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using WotBlitzStatisticsPro.DataAccess.Model.Accounts;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline
|
||||
{
|
||||
public interface IDatabasePipelineContext: IAccountPipelineContext
|
||||
{
|
||||
AccountInfo DbAccountInfo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Logic
|
||||
@@ -8,5 +9,8 @@ namespace WotBlitzStatisticsPro.Logic
|
||||
Task<AccountInfoResponse> GatherAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage);
|
||||
|
||||
Task<AccountInfoResponse> GatherAndSaveAccountInformation(RealmType realm, long accountId, RequestLanguage requestLanguage);
|
||||
|
||||
Task<AccountInfoHistoryResponse> GetAccountInfoHistory(RealmType realm, long accountId, DateTime startDate,
|
||||
RequestLanguage requestLanguage);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline;
|
||||
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations;
|
||||
@@ -53,5 +54,27 @@ namespace WotBlitzStatisticsPro.Logic
|
||||
|
||||
return context.Response;
|
||||
}
|
||||
|
||||
public async Task<AccountInfoHistoryResponse> GetAccountInfoHistory(RealmType realm, long accountId, DateTime startDate, RequestLanguage requestLanguage)
|
||||
{
|
||||
var context = new HistoryInformationPipelineContext(accountId, realm, requestLanguage);
|
||||
var pipeline = new Pipeline<HistoryInformationPipelineContext>(_operationFactory);
|
||||
|
||||
//pipeline.AddOperation<ReadAccountInfoFromDbOperation>()
|
||||
|
||||
// ToDo:
|
||||
// 1. First read account info from DB operation
|
||||
// 2. Read account history from DB at the startDate !Array SortedByDate! operation
|
||||
// 3. Fill the OverallAccountStatistics
|
||||
// PeriodAccountStatistics
|
||||
// PeriodDifference
|
||||
// StatisticsHistory
|
||||
|
||||
await pipeline.Build()
|
||||
.Invoke(context, null)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
return context.Response;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user