From b4617838ddc503817d2444bf246548bb40340c9a Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Thu, 4 Jun 2020 21:05:28 +0200 Subject: [PATCH] Rename methods to proper conventions --- ChaosBot/Services/LodestoneHttpProxy.cs | 16 ++++++++-------- ChaosBot/Services/LodestoneManager.cs | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChaosBot/Services/LodestoneHttpProxy.cs b/ChaosBot/Services/LodestoneHttpProxy.cs index 380b1fa..4075a9a 100644 --- a/ChaosBot/Services/LodestoneHttpProxy.cs +++ b/ChaosBot/Services/LodestoneHttpProxy.cs @@ -14,16 +14,16 @@ namespace ChaosBot.Services { public static class LodestoneHttpProxy { - public static T fetch(string endpoint) + public static T Fetch(string endpoint) { // TODO: implement some sort of local caching - return fetch(endpoint, new Dictionary()); + return Fetch(endpoint, new Dictionary()); } - public static T fetch(string endpoint, Dictionary parameters) + public static T Fetch(string endpoint, Dictionary parameters) { // TODO: implement some sort of local caching - return LodestoneHttpConnection.fetch(endpoint, parameters).GetAwaiter().GetResult(); + return LodestoneHttpConnection.Fetch(endpoint, parameters).GetAwaiter().GetResult(); } } @@ -31,15 +31,15 @@ namespace ChaosBot.Services { private static readonly Logger _logger = Program._logger; static HttpClient client = new HttpClient(); - private static bool firstRun = true; + private static bool _firstRun = true; - public static async Task fetch(string endpoint, Dictionary parameters) + public static async Task Fetch(string endpoint, Dictionary parameters) { try { - if (firstRun) + if (_firstRun) { - firstRun = false; + _firstRun = false; client.BaseAddress = new Uri("https://xivapi.com/"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add( diff --git a/ChaosBot/Services/LodestoneManager.cs b/ChaosBot/Services/LodestoneManager.cs index d74f0b4..dcaa9a7 100644 --- a/ChaosBot/Services/LodestoneManager.cs +++ b/ChaosBot/Services/LodestoneManager.cs @@ -25,13 +25,13 @@ namespace ChaosBot.Services Dictionary parameters = new Dictionary {{"name", name}, {"server", server}}; - PaginationWrapper characterWrapper = LodestoneHttpProxy.fetch>(GetEndpointPaths(Endpoints.CHARACTER_SEARCH), parameters); + PaginationWrapper characterWrapper = LodestoneHttpProxy.Fetch>(GetEndpointPaths(Endpoints.CHARACTER_SEARCH), parameters); return characterWrapper.Results.First(); } public static Character GetCharacter(long id) { - PaginationWrapper characterWrapper = LodestoneHttpProxy.fetch>(GetEndpointPaths(Endpoints.CHARACTER_SEARCH_BY_ID, id.ToString())); + PaginationWrapper characterWrapper = LodestoneHttpProxy.Fetch>(GetEndpointPaths(Endpoints.CHARACTER_SEARCH_BY_ID, id.ToString())); return characterWrapper.Results.First(); } @@ -40,12 +40,12 @@ namespace ChaosBot.Services Dictionary parameters = new Dictionary {{"name", name}, {"server", server}}; - PaginationWrapper freeCompanyWrapper = LodestoneHttpProxy.fetch>(GetEndpointPaths(Endpoints.FREECOMPANY_SEARCH), parameters); + PaginationWrapper freeCompanyWrapper = LodestoneHttpProxy.Fetch>(GetEndpointPaths(Endpoints.FREECOMPANY_SEARCH), parameters); return freeCompanyWrapper.Results.First(); } public static FreeCompany GetFreeCompanyById(string id) { - PaginationWrapper freeCompanyWrapper = LodestoneHttpProxy.fetch>(GetEndpointPaths(Endpoints.FREECOMPANY_SEARCH_BY_ID, id)); + PaginationWrapper freeCompanyWrapper = LodestoneHttpProxy.Fetch>(GetEndpointPaths(Endpoints.FREECOMPANY_SEARCH_BY_ID, id)); return freeCompanyWrapper.Results.First();} }