Clans search method

This commit is contained in:
Mikhail Shabanov committed 2020-05-19 14:22:47 +02:00
1 parent ed770e8c30
commit 5b88704edf
13 files changed
+179 -1

No files matched your search

@@ -10,6 +10,10 @@ namespace WotBlitzStatisticsPro.WgApiClient
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En);
Task<List<WotClanListResponse>> FindClans(string searchString,
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En);
Task<AccountInfo> GetPlayerAccountInfo(long accountId,
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En);
@@ -0,0 +1,38 @@
using Newtonsoft.Json;
namespace WotBlitzStatisticsPro.WgApiClient.Model
{
public class WotClanListResponse
{
///<summary>
/// Clan Id
///</summary>
[JsonProperty("clan_id")]
public long? ClanId { get; set; }
///<summary>
/// Clan Tag
///</summary>
[JsonProperty("tag")]
public string Tag { get; set; }
///<summary>
/// Clan Name
///</summary>
[JsonProperty("name")]
public string Name { get; set; }
///<summary>
/// Clan created at. (UNIX Epoch time)
///</summary>
[JsonProperty("created_at")]
public int CreatedAt { get; set; }
///<summary>
/// Clan members count
///</summary>
[JsonProperty("members_count")]
public int MembersCount { get; set; }
}
}
@@ -24,7 +24,17 @@ namespace WotBlitzStatisticsPro.WgApiClient
$"search={nickName}").ConfigureAwait(false);
}
// https://api.wotblitz.ru/wotb/clans/list/?application_id=adc1387489cf9fc8d9a1d85dbd27763d&search=xxx
public async Task<List<WotClanListResponse>> FindClans(string searchString,
RealmType realmType = RealmType.Ru,
RequestLanguage language = RequestLanguage.En)
{
return await GetFromBlitzApi<List<WotClanListResponse>>(
realmType,
language,
"clans/list/",
$"search={searchString}").ConfigureAwait(false);
}
public async Task<AccountInfo> GetPlayerAccountInfo(long accountId,
RealmType realmType = RealmType.Ru,