mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
feat(schedule)!: move schedule parser, downloader, and updater to external library
This can be used to support more schedule formats in the future.
This commit is contained in:
@@ -2,7 +2,7 @@ use self::schema::*;
|
||||
use crate::AppState;
|
||||
use crate::routes::schema::ResponseError;
|
||||
use actix_web::{get, web};
|
||||
use schedule_parser::schema::ScheduleEntry;
|
||||
use providers::base::ScheduleEntry;
|
||||
|
||||
#[utoipa::path(responses(
|
||||
(status = OK, body = ScheduleEntry),
|
||||
@@ -18,8 +18,9 @@ use schedule_parser::schema::ScheduleEntry;
|
||||
#[get("/teacher/{name}")]
|
||||
pub async fn teacher(name: web::Path<String>, app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
match app_state
|
||||
.get_schedule_snapshot()
|
||||
.get_schedule_snapshot("eng_polytechnic")
|
||||
.await
|
||||
.unwrap()
|
||||
.data
|
||||
.teachers
|
||||
.get(&name.into_inner())
|
||||
|
||||
Reference in New Issue
Block a user