2020-07-19 13:04:31 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-09-18 16:07:25 +02:00
|
|
|
using AutoMapper;
|
2020-07-19 13:04:31 +02:00
|
|
|
using WotBlitzStatisticsPro.Logic.Pipeline;
|
2020-09-18 16:07:25 +02:00
|
|
|
using WotBlitzStatisticsPro.WgApiClient;
|
2020-07-19 13:04:31 +02:00
|
|
|
|
|
|
|
|
namespace WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations
|
|
|
|
|
{
|
|
|
|
|
public class GetTanksInfoOperation: IOperation<AccountInformationPipelineContext>
|
|
|
|
|
{
|
2020-09-18 16:07:25 +02:00
|
|
|
private readonly IWargamingTanksApiClient _wargamingApi;
|
|
|
|
|
private readonly IMapper _mapper;
|
2020-07-19 13:04:31 +02:00
|
|
|
|
2020-09-18 16:07:25 +02:00
|
|
|
public GetTanksInfoOperation(
|
|
|
|
|
IWargamingTanksApiClient wargamingApi,
|
|
|
|
|
IMapper mapper)
|
|
|
|
|
{
|
|
|
|
|
_wargamingApi = wargamingApi;
|
|
|
|
|
_mapper = mapper;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task Invoke(AccountInformationPipelineContext context, Func<AccountInformationPipelineContext, Task> next)
|
|
|
|
|
{
|
|
|
|
|
var tanksInfo = await
|
|
|
|
|
_wargamingApi.GetPlayerAccountTanksInfo(context.AccountId, context.RealmType, context.RequestLanguage);
|
|
|
|
|
|
|
|
|
|
await next.Invoke(context);
|
2020-07-19 13:04:31 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|