mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 18:37:18 +02:00
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using WotBlitzStatisticsPro.Common.Model;
|
|
using WotBlitzStatisticsPro.WgApiClient;
|
|
|
|
namespace WotBlitzStatistics.GraphQl.Query
|
|
{
|
|
public class WotBlitzStatisticsQuery
|
|
{
|
|
private readonly IWargamingApiClient _wargamingApiClient;
|
|
|
|
public WotBlitzStatisticsQuery(IWargamingApiClient wargamingApiClient)
|
|
{
|
|
_wargamingApiClient = wargamingApiClient;
|
|
}
|
|
|
|
//public Task<AccountInfo> GetPlayerInfo(long accountId)
|
|
//{
|
|
// return _wargamingApiClient.GetPlayerAccountInfo(accountId);
|
|
//}
|
|
|
|
public async Task<AccountsSearchResponse> FindAccounts(string accountNick)
|
|
{
|
|
var response = await _wargamingApiClient.FindAccounts(accountNick);
|
|
// ToDo: Use auto mapper
|
|
var result = new AccountsSearchResponse
|
|
{
|
|
AccountsCount = response.Count,
|
|
Accounts = new List<AccountsSearchResponseItem>()
|
|
};
|
|
response.ForEach(r => result.Accounts.Add(new AccountsSearchResponseItem {AccountId = r.AccountId.Value, Nickname = r.Nickname}));
|
|
return result;
|
|
}
|
|
}
|
|
}
|