mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 02:17:20 +02:00
AchievementDictionaries saving done
This commit is contained in:
1 parent
cacc60fc7f
commit
6a9b69b254
11 files changed
+613
-3
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common.Model;
|
||||
using WotBlitzStatisticsPro.WgApiClient.Model;
|
||||
|
||||
@@ -11,5 +12,9 @@ namespace WotBlitzStatisticsPro.WgApiClient
|
||||
WotClanMembersDictionaryResponse)> GetStaticDictionariesAsync(
|
||||
RealmType realmType = RealmType.Ru,
|
||||
RequestLanguage language = RequestLanguage.En);
|
||||
|
||||
Task<List<WotEncyclopediaAchievementsResponse>> GetAchievementsDictionary(
|
||||
RealmType realmType = RealmType.Ru,
|
||||
RequestLanguage language = RequestLanguage.En);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WotBlitzStatisticsPro.WgApiClient.Model
|
||||
{
|
||||
public class WotEncyclopediaAchievementsResponse
|
||||
{
|
||||
[JsonProperty("achievement_id")]
|
||||
public string AchievementId { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement condition
|
||||
///</summary>
|
||||
[JsonProperty("condition")]
|
||||
public string Condition { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement description
|
||||
///</summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Historical info
|
||||
///</summary>
|
||||
[JsonProperty("hero_info")]
|
||||
public string HeroInfo { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Image link
|
||||
///</summary>
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Image 180x180px link
|
||||
///</summary>
|
||||
[JsonProperty("image_big")]
|
||||
public string ImageBig { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement name
|
||||
///</summary>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Sort order
|
||||
///</summary>
|
||||
[JsonProperty("order")]
|
||||
public long? Order { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Is outdated achievement
|
||||
///</summary>
|
||||
[JsonProperty("outdated")]
|
||||
public bool Outdated { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement section
|
||||
///</summary>
|
||||
[JsonProperty("section")]
|
||||
public string Section { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement section order
|
||||
///</summary>
|
||||
[JsonProperty("section_order")]
|
||||
public long? SectionOrder { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement Type
|
||||
///</summary>
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Achievement options
|
||||
///</summary>
|
||||
[JsonProperty("options")]
|
||||
public WotEncyclopediaAchievementsOptions[] Options { get; set; }
|
||||
}
|
||||
|
||||
public class WotEncyclopediaAchievementsOptions
|
||||
{
|
||||
|
||||
///<summary>
|
||||
/// Achievement description
|
||||
///</summary>
|
||||
[JsonProperty("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Image link
|
||||
///</summary>
|
||||
[JsonProperty("image")]
|
||||
public string Image { get; set; }
|
||||
|
||||
///<summary>
|
||||
/// Image 180x180px link
|
||||
///</summary>
|
||||
[JsonProperty("image_big")]
|
||||
public string ImageBig { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using WotBlitzStatisticsPro.Common;
|
||||
@@ -65,6 +66,15 @@ namespace WotBlitzStatisticsPro.WgApiClient
|
||||
return (encyclopedia, clanGlossaryResponse);
|
||||
}
|
||||
|
||||
public async Task<List<WotEncyclopediaAchievementsResponse>> GetAchievementsDictionary(RealmType realmType = RealmType.Ru, RequestLanguage language = RequestLanguage.En)
|
||||
{
|
||||
var response = await GetFromBlitzApi<Dictionary<string, WotEncyclopediaAchievementsResponse>>(
|
||||
realmType,
|
||||
language,
|
||||
"encyclopedia/achievements/").ConfigureAwait(false);
|
||||
|
||||
return response.Values.ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in new issue
Block a user