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])