diff --git a/src/Public.Api/Address/AddressController-BestAdd.cs b/src/Public.Api/Address/AddressController-BestAdd.cs deleted file mode 100644 index c87d1fd67..000000000 --- a/src/Public.Api/Address/AddressController-BestAdd.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Public.Api.Address -{ - using System.Threading; - using System.Threading.Tasks; - using AddressRegistry.Api.Legacy.Address.Bosa; - using Common.Infrastructure; - using Infrastructure; - using Infrastructure.Configuration; - using Microsoft.AspNetCore.Mvc; - using Microsoft.AspNetCore.Mvc.Infrastructure; - using Microsoft.Extensions.Options; - using RestSharp; - - public partial class AddressController - { - [HttpPost("bosa/adressen", Name = nameof(SearchBestAddAddress))] - [ApiExplorerSettings(IgnoreApi = true)] - public async Task SearchBestAddAddress( - [FromServices] IActionContextAccessor actionContextAccessor, - [FromServices] IOptions responseOptions, - [FromHeader(Name = HeaderNames.IfNoneMatch)] string ifNoneMatch, - [FromBody] AddressBosaRequest searchBody, - CancellationToken cancellationToken = default) - { - var contentFormat = DetermineFormat(actionContextAccessor.ActionContext); - - RestRequest BackendRequest() => CreateBackendSearchBestAddRequest(searchBody); - - var value = await GetFromBackendAsync( - contentFormat.ContentType, - BackendRequest, - CreateDefaultHandleBadRequest(), - cancellationToken); - - return BackendListResponseResult.Create(value, Request.Query, responseOptions.Value.VolgendeUrl); - } - - private static RestRequest CreateBackendSearchBestAddRequest(AddressBosaRequest searchBody) - => new RestRequest("adressen/bosa", Method.Post).AddJsonBodyOrEmpty(searchBody); - } -} diff --git a/src/Public.Api/AddressRepresentation/AddressRepresentationController-BestAdd.cs b/src/Public.Api/AddressRepresentation/AddressRepresentationController-BestAdd.cs deleted file mode 100644 index 6ef0b7018..000000000 --- a/src/Public.Api/AddressRepresentation/AddressRepresentationController-BestAdd.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Public.Api.AddressRepresentation -{ - using System.Threading; - using System.Threading.Tasks; - using AddressRegistry.Api.Legacy.Address.BosaRepresentation; - using Common.Infrastructure; - using Infrastructure; - using Infrastructure.Configuration; - using Microsoft.AspNetCore.Mvc; - using Microsoft.AspNetCore.Mvc.Infrastructure; - using Microsoft.Extensions.Options; - using RestSharp; - - public partial class AddressRepresentationController - { - [HttpPost("bosa/adresvoorstellingen", Name = nameof(SearchBestAddAddressRepresentation))] - [ApiExplorerSettings(IgnoreApi = true)] - public async Task SearchBestAddAddressRepresentation( - [FromServices] IActionContextAccessor actionContextAccessor, - [FromServices] IOptions responseOptions, - [FromHeader(Name = HeaderNames.IfNoneMatch)] string ifNoneMatch, - [FromBody] AddressRepresentationBosaRequest searchBody, - CancellationToken cancellationToken = default) - { - var contentFormat = DetermineFormat(actionContextAccessor.ActionContext); - - RestRequest BackendRequest() => CreateBackendSearchBestAddRequest(searchBody); - - var value = await GetFromBackendAsync( - contentFormat.ContentType, - BackendRequest, - CreateDefaultHandleBadRequest(), - cancellationToken); - - return BackendListResponseResult.Create(value, Request.Query, responseOptions.Value.VolgendeUrl); - } - - private static RestRequest CreateBackendSearchBestAddRequest(AddressRepresentationBosaRequest searchBody) - => new RestRequest("adressen/bosa/adresvoorstellingen", Method.Post).AddJsonBodyOrEmpty(searchBody); - } -} diff --git a/src/Public.Api/AddressRepresentation/AddressRepresentationController.cs b/src/Public.Api/AddressRepresentation/AddressRepresentationController.cs deleted file mode 100755 index f24dc942f..000000000 --- a/src/Public.Api/AddressRepresentation/AddressRepresentationController.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace Public.Api.AddressRepresentation -{ - using Autofac.Features.AttributeFilters; - using Be.Vlaanderen.Basisregisters.Api; - using Common.Infrastructure; - using Common.Infrastructure.Controllers; - using Common.Infrastructure.Controllers.Attributes; - using FeatureToggle; - using Infrastructure.Configuration; - using Infrastructure.Swagger; - using Infrastructure.Version; - using Microsoft.AspNetCore.Http; - using Microsoft.AspNetCore.Mvc; - using Microsoft.Extensions.Logging; - using RestSharp; - - [ApiVersion(Version.Current)] - [AdvertiseApiVersions(Version.CurrentAdvertised)] - [ApiRoute("")] - [ApiExplorerSettings(GroupName = "Adresvoorstellingen")] - [ApiOrder(ApiOrder.AddressRepresentation)] - [ApiProduces] - public partial class AddressRepresentationController : RegistryApiController - { - protected override string NotFoundExceptionMessage => "Onbestaand adres."; - protected override string GoneExceptionMessage => "Verwijderd adres."; - - public AddressRepresentationController( - IHttpContextAccessor httpContextAccessor, - [KeyFilter(RegistryKeys.Address)] IRestClient restClient, - [KeyFilter(RegistryKeys.Address)] IFeatureToggle cacheToggle, - ConnectionMultiplexerProvider redis, - ILogger logger) - : base(httpContextAccessor, redis, logger, restClient, cacheToggle) { } - - private static ContentFormat DetermineFormat(ActionContext context) - => ContentFormat.For(EndpointType.Legacy, context); - } -} diff --git a/src/Public.Api/Municipality/MunicipalityController-BestAdd.cs b/src/Public.Api/Municipality/MunicipalityController-BestAdd.cs deleted file mode 100644 index 70f8ef3a9..000000000 --- a/src/Public.Api/Municipality/MunicipalityController-BestAdd.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Public.Api.Municipality -{ - using System.Threading; - using System.Threading.Tasks; - using Common.Infrastructure; - using Infrastructure; - using Infrastructure.Configuration; - using Microsoft.AspNetCore.Mvc; - using Microsoft.AspNetCore.Mvc.Infrastructure; - using Microsoft.Extensions.Options; - using MunicipalityRegistry.Api.Legacy.Municipality.Requests; - using RestSharp; - - public partial class MunicipalityController - { - [HttpPost("bosa/gemeenten", Name = nameof(SearchBestAddMunicipality))] - [ApiExplorerSettings(IgnoreApi = true)] - public async Task SearchBestAddMunicipality( - [FromServices] IActionContextAccessor actionContextAccessor, - [FromServices] IOptions responseOptions, - [FromHeader(Name = HeaderNames.IfNoneMatch)] string ifNoneMatch, - [FromBody] BosaMunicipalityRequest searchBody, - CancellationToken cancellationToken = default) - { - var contentFormat = DetermineFormat(actionContextAccessor.ActionContext); - - RestRequest BackendRequest() => CreateBackendSearchBestAddRequest(searchBody); - - var value = await GetFromBackendAsync( - contentFormat.ContentType, - BackendRequest, - CreateDefaultHandleBadRequest(), - cancellationToken); - - return BackendListResponseResult.Create(value, Request.Query, responseOptions.Value.VolgendeUrl); - } - - private static RestRequest CreateBackendSearchBestAddRequest(BosaMunicipalityRequest searchBody) - => new RestRequest("gemeenten/bosa", Method.Post).AddJsonBodyOrEmpty(searchBody); - } -} diff --git a/src/Public.Api/StreetName/StreetNameController-BestAdd.cs b/src/Public.Api/StreetName/StreetNameController-BestAdd.cs deleted file mode 100644 index 0649eaaef..000000000 --- a/src/Public.Api/StreetName/StreetNameController-BestAdd.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace Public.Api.StreetName -{ - using System.Threading; - using System.Threading.Tasks; - using Common.Infrastructure; - using Infrastructure; - using Infrastructure.Configuration; - using Microsoft.AspNetCore.Mvc; - using Microsoft.AspNetCore.Mvc.Infrastructure; - using Microsoft.Extensions.Options; - using RestSharp; - using StreetNameRegistry.Api.Legacy.StreetName.Bosa; - - public partial class StreetNameController - { - [HttpPost("bosa/straatnamen", Name = nameof(SearchBestAddStreetName))] - [ApiExplorerSettings(IgnoreApi = true)] - public async Task SearchBestAddStreetName( - [FromServices] IActionContextAccessor actionContextAccessor, - [FromServices] IOptions responseOptions, - [FromHeader(Name = HeaderNames.IfNoneMatch)] string ifNoneMatch, - [FromBody] BosaStreetNameRequest searchBody, - CancellationToken cancellationToken = default) - { - var contentFormat = DetermineFormat(actionContextAccessor.ActionContext); - - RestRequest BackendRequest() => CreateBackendSearchBestAddRequest(searchBody); - - var value = await GetFromBackendAsync( - contentFormat.ContentType, - BackendRequest, - CreateDefaultHandleBadRequest(), - cancellationToken); - - return BackendListResponseResult.Create(value, Request.Query, responseOptions.Value.VolgendeUrl); - } - - private static RestRequest CreateBackendSearchBestAddRequest(BosaStreetNameRequest searchBody) - => new RestRequest("straatnamen/bosa", Method.Post).AddJsonBodyOrEmpty(searchBody); - } -}