featwip: pretty departures

This commit is contained in:
Cilly Leang 2026-04-13 03:58:00 +10:00
parent ef630b6d58
commit 4e1e05495d
Signed by: cilly
GPG key ID: 6500251E087653C9
13 changed files with 264 additions and 37 deletions

View file

@ -118,6 +118,16 @@ fun Application.module() {
else
call.respond(HttpStatusCode.NotFound)
}
get("/routes/by_trip/{trip_id}") {
val tripId = call.parameters["trip_id"]!!
val route = withContext(context = Dispatchers.IO) {
get<RouteDao>().getByTrip(tripId)
}
if (route != null)
call.respond(route.asModel())
else
call.respond(HttpStatusCode.NotFound)
}
get("/stops") {
val routes = withContext(context = Dispatchers.IO) {
get<StopDao>().getAll()