refactor(parser): rewrite some parts of code

This commit is contained in:
2025-05-26 05:20:41 +04:00
parent ff9d7d6c3a
commit ba8b164b6a
16 changed files with 418 additions and 330 deletions

View File

@@ -39,7 +39,7 @@ pub async fn group(user: SyncExtractor<User>, app_state: web::Data<AppState>) ->
}
mod schema {
use crate::parser::schema::ScheduleEntry;
use schedule_parser::schema::ScheduleEntry;
use actix_macros::{IntoResponseErrorNamed, StatusCode};
use chrono::{DateTime, NaiveDateTime, Utc};
use derive_more::Display;

View File

@@ -1,5 +1,5 @@
use crate::app_state::{AppState, Schedule};
use crate::parser::schema::ScheduleEntry;
use schedule_parser::schema::ScheduleEntry;
use actix_macros::{IntoResponseErrorNamed, ResponderJson, StatusCode};
use actix_web::web;
use chrono::{DateTime, Duration, Utc};

View File

@@ -40,7 +40,7 @@ pub async fn teacher(
}
mod schema {
use crate::parser::schema::ScheduleEntry;
use schedule_parser::schema::ScheduleEntry;
use actix_macros::{IntoResponseErrorNamed, StatusCode};
use chrono::{DateTime, NaiveDateTime, Utc};
use derive_more::Display;

View File

@@ -1,7 +1,7 @@
use self::schema::*;
use crate::AppState;
use crate::app_state::Schedule;
use crate::parser::parse_xls;
use schedule_parser::parse_xls;
use crate::routes::schedule::schema::CacheStatus;
use crate::routes::schema::{IntoResponseAsError, ResponseError};
use crate::xls_downloader::interface::{FetchError, XLSDownloader};
@@ -79,7 +79,7 @@ pub async fn update_download_url(
}
mod schema {
use crate::parser::schema::ParseError;
use schedule_parser::schema::ParseError;
use crate::routes::schedule::schema::CacheStatus;
use actix_macros::{IntoResponseErrorNamed, StatusCode};
use derive_more::Display;