using Microsoft.AspNetCore.Mvc; using PhilExampleCrawler.Common.Models; using PhilExampleCrawler.DataBase; using PhilExampleCrawler.DataBase.Models; namespace WebAPI.Controllers { [ApiController] [Route("[controller]/[action]")] public class ExamplePageController : ControllerBase { private readonly ILogger _logger; private readonly HttpClient _httpClient; public ExamplePageController(ILogger logger, IHttpClientFactory httpClientFactory) { _logger = logger; _httpClient = httpClientFactory.CreateClient(); } [HttpGet] public async Task> GetCategoriesAsync() { var cats = await PhilExampleCrawler.Core.ExamplePageValueCrawler.CrawlExamplePageCategories(_httpClient); return cats; } [HttpGet] public IEnumerable GetRadii() { var radii = new List() { new Category("Unbegrenzt", 0), new Category("+ 5 km", 5), new Category("+ 10 km", 10), new Category("+ 50 km", 50), new Category("+ 100 km", 100), new Category("+ 500 km", 500), new Category("+ 1000 km", 1000), }; return radii; } } }