From 3107fea36f7805abfdc250cf253395bdbf0f502f Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 5 Dec 2021 15:18:19 +0100 Subject: [PATCH] added date-specific timetable request --- Cargo.toml | 2 +- src/main.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9684fbc..38909c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "api" -version = "0.7.5" +version = "0.7.6" edition = "2018" license = "AGPL-3.0-or-later" authors = ["Denys Konovalov "] diff --git a/src/main.rs b/src/main.rs index 64c9a86..7b0c420 100644 --- a/src/main.rs +++ b/src/main.rs @@ -245,6 +245,18 @@ async fn get_tomorrow_class_timetable( Json::from(timetable) } +#[get("//")] +async fn get_daily_class_timetable( + conn: DbConn, + class: String, + key: ApiKey<'_>, + date: String, +) -> Json { + let timetable = + timetable_connector::get_class_timetable(conn, class, format!("PlanKl{}.xml", date)).await; + Json::from(timetable) +} + #[get("/")] async fn get_classes(_key: ApiKey<'_>) -> Json> { let class_list = timetable_connector::get_classes().await;