diff --git a/src/Web/WebMVC/Controllers/TestController.cs b/src/Web/WebMVC/Controllers/TestController.cs deleted file mode 100644 index 680099cf4..000000000 --- a/src/Web/WebMVC/Controllers/TestController.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace WebMVC.Controllers; - -class TestPayload -{ - public int CatalogItemId { get; set; } - - public string BasketId { get; set; } - - public int Quantity { get; set; } -} - -[Authorize] -public class TestController : Controller -{ - private readonly IHttpClientFactory _client; - private readonly IIdentityParser _appUserParser; - - public TestController(IHttpClientFactory client, IIdentityParser identityParser) - { - _client = client; - _appUserParser = identityParser; - } - - public async Task Ocelot() - { - var url = "http://apigw/shopping/api/v1/basket/items"; - - var payload = new TestPayload() - { - CatalogItemId = 1, - Quantity = 1, - BasketId = _appUserParser.Parse(User).Id - }; - - var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"); - - - var response = await _client.CreateClient(nameof(IBasketService)) - .PostAsync(url, content); - - if (response.IsSuccessStatusCode) - { - var str = await response.Content.ReadAsStringAsync(); - - return Ok(str); - } - else - { - return Ok(new { response.StatusCode, response.ReasonPhrase }); - } - } -}