Added GraphQl Server and wg API client

This commit is contained in:
Michael Shabanov committed 2020-02-15 16:00:42 +03:00
1 parent a0ad7ca395
commit abc99c835c
25 files changed
+872 -1

No files matched your search

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using WotBlitzStatisticsPro.WgApiClient.Model;
namespace WotBlitzStatisticsPro.WgApiClient
{
public class WargamingApiClient : WagramingApiClientBase, IWargamingApiClient
{
public WargamingApiClient(
HttpClient httpClient,
IWargamingApiSettings wargamingApiSettings) : base(httpClient, wargamingApiSettings)
{
}
public Task<Dictionary<long, string>> FindAccounts(string nickName,
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En)
{
throw new NotImplementedException();
}
public async Task<AccountInfo> GetPlayerAccountInfo(long accountId,
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En)
{
var account = await GetFromBlitzApi<Dictionary<string, AccountInfo>>(
realmType,
language,
"account/info/",
$"account_id={accountId}");
return account[accountId.ToString()];
}
}
}