From f6156559f8631203f6f0a6c4f0029e4c9c81a010 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 5 Dec 2021 15:26:29 +0100 Subject: [PATCH] fixed issues --- src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7b0c420..0941390 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,6 +201,16 @@ async fn get_tomorrow_timetable( Json::from(timetable) } +#[get("/date/")] +async fn get_daily_timetable( + conn: DbConn, + _key: ApiKey<'_>, + date: String, +) -> Json> { + let timetable = timetable_connector::get_timetable(conn, format!("PlanKl{}.xml", date)).await; + Json::from(timetable) +} + #[get("/")] async fn get_latest_class_timetable( conn: DbConn, @@ -249,7 +259,7 @@ async fn get_tomorrow_class_timetable( async fn get_daily_class_timetable( conn: DbConn, class: String, - key: ApiKey<'_>, + _key: ApiKey<'_>, date: String, ) -> Json { let timetable = @@ -286,7 +296,9 @@ fn rocket() -> _ { get_today_timetable, get_today_class_timetable, get_tomorrow_timetable, - get_tomorrow_class_timetable + get_tomorrow_class_timetable, + get_daily_timetable, + get_daily_class_timetable ], ) .mount("/api/classes", routes![get_classes])