diff --git a/WotBlitzStatisticsPro.Blazor/graphql/VehiclesDictionary.graphql b/WotBlitzStatisticsPro.Blazor/graphql/VehiclesDictionary.graphql new file mode 100644 index 0000000..c933cd1 --- /dev/null +++ b/WotBlitzStatisticsPro.Blazor/graphql/VehiclesDictionary.graphql @@ -0,0 +1,16 @@ +query dictionary($nationId: String!, $requestLanguage: RequestLanguage!) { + vehicles(nationId: $nationId, language: $requestLanguage) { + tankId + name + description + isPremium + typeId + nationId + tier + previewImage + normalImage + priceCredit + priceGold + nexTanksInTree + } +} diff --git a/WotBlitzStatisticsPro.Common/Model/VehicleResponse.cs b/WotBlitzStatisticsPro.Common/Model/VehicleResponse.cs new file mode 100644 index 0000000..85c4a48 --- /dev/null +++ b/WotBlitzStatisticsPro.Common/Model/VehicleResponse.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; + +namespace WotBlitzStatisticsPro.Common.Model +{ + /// + /// Response for vehicle dictionary query + /// + public class VehicleResponse + { + /// + /// VehicleId + /// + public long TankId { get; set; } + + /// + /// Vehicle name + /// + public string Name { get; set; } = string.Empty; + + /// + /// Vehicle description + /// + public string Description { get; set; } = string.Empty; + + /// + /// Is vehicle premium + /// + public bool IsPremium { get; set; } + + /// + /// Vehicle type id + /// + public string TypeId { get; set; } = string.Empty; + + /// + /// Vehicle nationId + /// + public string NationId { get; set; } = string.Empty; + + /// + /// Vehicle tier + /// + public int Tier { get; set; } + + /// + /// Vehicle preview image + /// + public string PreviewImage { get; set; } = string.Empty; + + /// + /// Vehicle normal image + /// + public string NormalImage { get; set; } = string.Empty; + + /// + /// Vehicle price in credits + /// + public decimal PriceCredit { get; set; } + + /// + /// Vehicle price in gold + /// + public decimal PriceGold { get; set; } + + /// + /// Ids of nex tanks and their cost in XP + /// + public List? NexTanksInTree { get; set; } + } +} \ No newline at end of file diff --git a/WotBlitzStatisticsPro.GraphQl/Query/VehiclesQuery.cs b/WotBlitzStatisticsPro.GraphQl/Query/VehiclesQuery.cs new file mode 100644 index 0000000..57f3394 --- /dev/null +++ b/WotBlitzStatisticsPro.GraphQl/Query/VehiclesQuery.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using HotChocolate.Types; +using WotBlitzStatisticsPro.Common.Model; +using WotBlitzStatisticsPro.Logic; + +namespace WotBlitzStatisticsPro.GraphQl.Query +{ + [ExtendObjectType(Name = "Query")] + public class VehiclesQuery + { + /// + /// Returns a list of all vehicles of one nation + /// + /// Nation + /// Request language + /// A list of vehicles + public async Task> GetVehicles(string nationId, RequestLanguage? language) + { + return new List(); + } + } +} \ No newline at end of file diff --git a/WotBlitzStatisticsPro.GraphQl/Startup.cs b/WotBlitzStatisticsPro.GraphQl/Startup.cs index 5f207d2..016e12e 100644 --- a/WotBlitzStatisticsPro.GraphQl/Startup.cs +++ b/WotBlitzStatisticsPro.GraphQl/Startup.cs @@ -91,6 +91,7 @@ namespace WotBlitzStatisticsPro.GraphQl .AddType() .AddType() .AddType() + .AddType() .AddMutationType(d => d.Name("Mutation")) .AddType() .AddType()