2020-05-18 17:29:54 +02:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using WotBlitzStatistics.Logic;
|
2020-04-14 11:16:51 +02:00
|
|
|
using WotBlitzStatisticsPro.Common.Model;
|
2020-05-18 17:29:54 +02:00
|
|
|
using WotBlitzStatisticsPro.WgApiClient.Model;
|
2020-02-15 16:00:42 +03:00
|
|
|
|
|
|
|
|
namespace WotBlitzStatistics.GraphQl.Query
|
|
|
|
|
{
|
|
|
|
|
public class WotBlitzStatisticsQuery
|
|
|
|
|
{
|
2020-05-18 17:29:54 +02:00
|
|
|
private readonly IWargamingSearch _wargamingSearcher;
|
2020-02-15 16:00:42 +03:00
|
|
|
|
2020-05-18 17:29:54 +02:00
|
|
|
public WotBlitzStatisticsQuery(IWargamingSearch wargamingSearcher)
|
2020-02-15 16:00:42 +03:00
|
|
|
{
|
2020-05-18 17:29:54 +02:00
|
|
|
_wargamingSearcher = wargamingSearcher;
|
2020-02-15 16:00:42 +03:00
|
|
|
}
|
|
|
|
|
|
2020-04-14 11:16:51 +02:00
|
|
|
//public Task<AccountInfo> GetPlayerInfo(long accountId)
|
|
|
|
|
//{
|
2020-05-18 17:29:54 +02:00
|
|
|
// return _wargamingSearcher.GetPlayerAccountInfo(accountId);
|
2020-04-14 11:16:51 +02:00
|
|
|
//}
|
|
|
|
|
|
2020-05-19 14:22:47 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Finds Wargaming accounts by nick
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="accountNick">Search string.</param>
|
|
|
|
|
/// <param name="realmType">Wargaming Realm.</param>
|
|
|
|
|
/// <param name="language">Language for the output data.</param>
|
|
|
|
|
/// <returns></returns>
|
2020-05-18 17:29:54 +02:00
|
|
|
public Task<AccountsSearchResponse> FindAccounts(
|
|
|
|
|
string accountNick,
|
|
|
|
|
RealmType? realmType,
|
|
|
|
|
RequestLanguage? language)
|
2020-02-15 16:00:42 +03:00
|
|
|
{
|
2020-05-18 17:29:54 +02:00
|
|
|
return _wargamingSearcher.FindAccounts(accountNick, realmType ?? RealmType.Ru, language ?? RequestLanguage.En);
|
2020-02-15 16:00:42 +03:00
|
|
|
}
|
2020-05-19 14:22:47 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Finds clans by search string
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="searchString">Search string.</param>
|
|
|
|
|
/// <param name="realmType">Wargaming Realm.</param>
|
|
|
|
|
/// <param name="language">Language for the output data.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public Task<ClanSearchResponse> FindClans(
|
|
|
|
|
string searchString,
|
|
|
|
|
RealmType? realmType,
|
|
|
|
|
RequestLanguage? language)
|
|
|
|
|
{
|
|
|
|
|
return _wargamingSearcher.FindClans(searchString, realmType ?? RealmType.Ru, language ?? RequestLanguage.En);
|
|
|
|
|
}
|
2020-02-15 16:00:42 +03:00
|
|
|
}
|
|
|
|
|
}
|