mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 11:20:05 +02:00
Added GraphQl Server and wg API client
This commit is contained in:
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()];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user