From 9d3437b268ceb08da0d336dc8d806fcd6638a283 Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Thu, 8 Aug 2024 16:59:57 +0200 Subject: [PATCH] Remove unused methods and interfaces from repository classes --- .../FunderMapsDataServiceCollectionExtensions.cs | 3 ++- src/FunderMaps.Incident/Program.cs | 1 + .../Controllers/Application/MetaController.cs | 5 +++-- .../Controllers/GeocoderController.cs | 12 ++++++------ src/FunderMaps.WebApi/Program.cs | 1 + src/FunderMaps.Webservice/Program.cs | 1 + src/FunderMaps.Worker/Program.cs | 1 + 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/FunderMaps.Data/Extensions/FunderMapsDataServiceCollectionExtensions.cs b/src/FunderMaps.Data/Extensions/FunderMapsDataServiceCollectionExtensions.cs index abf5685d..8baa9a56 100644 --- a/src/FunderMaps.Data/Extensions/FunderMapsDataServiceCollectionExtensions.cs +++ b/src/FunderMaps.Data/Extensions/FunderMapsDataServiceCollectionExtensions.cs @@ -5,8 +5,9 @@ using FunderMaps.Data.Repositories; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; -namespace Microsoft.Extensions.DependencyInjection; +namespace FunderMaps.Data.Extensions; /// /// Provides extension methods for services from this assembly. diff --git a/src/FunderMaps.Incident/Program.cs b/src/FunderMaps.Incident/Program.cs index 46d888b2..1e40011d 100644 --- a/src/FunderMaps.Incident/Program.cs +++ b/src/FunderMaps.Incident/Program.cs @@ -1,5 +1,6 @@ using FunderMaps.Core.Extensions; using FunderMaps.Core.ExternalServices; +using FunderMaps.Data.Extensions; using FunderMaps.Incident.Components; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Diagnostics.HealthChecks; diff --git a/src/FunderMaps.WebApi/Controllers/Application/MetaController.cs b/src/FunderMaps.WebApi/Controllers/Application/MetaController.cs index 9f770ee8..9e89228b 100644 --- a/src/FunderMaps.WebApi/Controllers/Application/MetaController.cs +++ b/src/FunderMaps.WebApi/Controllers/Application/MetaController.cs @@ -18,8 +18,9 @@ public sealed class MetaController(IUserdataRepository userdataRepository) : Fun [HttpGet] public async Task GetAllAsync() { - var rs = await userdataRepository.GetAsync(UserId, "app-0blu4s39"); // TODO: Move to ENV - return Content(rs.ToString(), "application/json"); // TODO + // TODO: Create a UserData entity + var metadata = await userdataRepository.GetAsync(UserId, "app-0blu4s39"); // TODO: Move to ENV + return Content(metadata.ToString() ?? "{}", "application/json"); } // PUT: api/metadata diff --git a/src/FunderMaps.WebApi/Controllers/GeocoderController.cs b/src/FunderMaps.WebApi/Controllers/GeocoderController.cs index 50f3fbb5..09603c3c 100644 --- a/src/FunderMaps.WebApi/Controllers/GeocoderController.cs +++ b/src/FunderMaps.WebApi/Controllers/GeocoderController.cs @@ -58,10 +58,10 @@ public Task GetNeighborhoodAsync(string id) // GET: api/geocoder/district/{id} /// - /// Get district by identifier. + /// Get district by identifier. /// /// - /// Cache response for 12 hours. District will not change often. + /// Cache response for 12 hours. District will not change often. /// [HttpGet("district/{id}"), ResponseCache(Duration = 60 * 60 * 12)] public Task GetDistrictAsync(string id) @@ -69,10 +69,10 @@ public Task GetDistrictAsync(string id) // GET: api/geocoder/municipality/{id} /// - /// Get municipality by identifier. + /// Get municipality by identifier. /// /// - /// Cache response for 12 hours. Municipality will not change often. + /// Cache response for 12 hours. Municipality will not change often. /// [HttpGet("municipality/{id}"), ResponseCache(Duration = 60 * 60 * 12)] public Task GetMunicipalityAsync(string id) @@ -80,10 +80,10 @@ public Task GetMunicipalityAsync(string id) // GET: api/geocoder/state/{id} /// - /// Get state by identifier. + /// Get state by identifier. /// /// - /// Cache response for 12 hours. State will not change often. + /// Cache response for 12 hours. State will not change often. /// [HttpGet("state/{id}"), ResponseCache(Duration = 60 * 60 * 12)] public Task GetStateAsync(string id) diff --git a/src/FunderMaps.WebApi/Program.cs b/src/FunderMaps.WebApi/Program.cs index ca8b4ae1..f1bd2ad4 100644 --- a/src/FunderMaps.WebApi/Program.cs +++ b/src/FunderMaps.WebApi/Program.cs @@ -1,5 +1,6 @@ using FunderMaps.Core.Extensions; using FunderMaps.Core.Middleware; +using FunderMaps.Data.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.HttpOverrides; diff --git a/src/FunderMaps.Webservice/Program.cs b/src/FunderMaps.Webservice/Program.cs index 796fcabf..8d519985 100644 --- a/src/FunderMaps.Webservice/Program.cs +++ b/src/FunderMaps.Webservice/Program.cs @@ -1,5 +1,6 @@ using FunderMaps.Core.Extensions; using FunderMaps.Core.Middleware; +using FunderMaps.Data.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.HttpOverrides; diff --git a/src/FunderMaps.Worker/Program.cs b/src/FunderMaps.Worker/Program.cs index 11f4ee28..1a26f736 100644 --- a/src/FunderMaps.Worker/Program.cs +++ b/src/FunderMaps.Worker/Program.cs @@ -1,4 +1,5 @@ using FunderMaps.Worker; +using FunderMaps.Data.Extensions; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting;