From a304c24b32c0327436bbd8c2853e60668e161b42 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 29 Dec 2025 00:41:52 +0100 Subject: Rename a lot of stuff, add Santiago real time --- .../OpenTripPlannerClient.cs | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/OpenTripPlannerClient.cs (limited to 'src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/OpenTripPlannerClient.cs') diff --git a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/OpenTripPlannerClient.cs b/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/OpenTripPlannerClient.cs deleted file mode 100644 index eed78d6..0000000 --- a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/OpenTripPlannerClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Net.Http.Json; -using Costasdev.Busurbano.Sources.OpenTripPlannerGql.Queries; -using Microsoft.Extensions.Logging; - -namespace Costasdev.Busurbano.Sources.OpenTripPlannerGql; - -public class OpenTripPlannerClient -{ - private readonly HttpClient _httpClient; - private readonly string _baseUrl; - private readonly ILogger _logger; - - public OpenTripPlannerClient( - HttpClient httpClient, - string baseUrl, - ILogger logger - ) - { - _httpClient = httpClient; - _baseUrl = baseUrl; - _logger = logger; - } - - public async Task GetStopsInBbox(double minLat, double minLon, double maxLat, double maxLon) - { - var requestContent = - StopTileRequestContent.Query(new StopTileRequestContent.Bbox(minLon, minLat, maxLon, maxLat)); - - var request = new HttpRequestMessage(HttpMethod.Post, $"{_baseUrl}/gtfs/v1"); - request.Content = JsonContent.Create(new GraphClientRequest - { - Query = requestContent - }); - - var response = await _httpClient.SendAsync(request); - var responseBody = await response.Content.ReadFromJsonAsync>(); - - if (responseBody is not { IsSuccess: true }) - { - _logger.LogError( - "Error fetching stop data, received {StatusCode} {ResponseBody}", - response.StatusCode, - await response.Content.ReadAsStringAsync() - ); - } - } -} -- cgit v1.3