mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
Реформат путей к эндпоинтам.
Добавлен экстрактор пользователя с дополнительными полями.
Добавлена связь таблиц User и FCM.
Завершена реализация авторизации с помощью VK ID.
Добавлен эндпоинт fcm/update-callback/{version}.
This commit is contained in:
@@ -6,7 +6,7 @@ use actix_web::{get, web};
|
||||
(status = OK, body = CacheStatus),
|
||||
))]
|
||||
#[get("/cache-status")]
|
||||
pub async fn get_cache_status(app_state: web::Data<AppState>) -> CacheStatus {
|
||||
pub async fn cache_status(app_state: web::Data<AppState>) -> CacheStatus {
|
||||
// Prevent thread lock
|
||||
let has_schedule = app_state
|
||||
.schedule
|
||||
@@ -25,7 +25,7 @@ use actix_web::{get, web};
|
||||
),
|
||||
))]
|
||||
#[get("/group")]
|
||||
pub async fn get_group(
|
||||
pub async fn group(
|
||||
user: SyncExtractor<User>,
|
||||
app_state: web::Data<AppState>,
|
||||
) -> ServiceResponse {
|
||||
@@ -9,7 +9,7 @@ use actix_web::{get, web};
|
||||
(status = SERVICE_UNAVAILABLE, body = ResponseError<ErrorCode>),
|
||||
))]
|
||||
#[get("/group-names")]
|
||||
pub async fn get_group_names(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
pub async fn group_names(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
// Prevent thread lock
|
||||
let schedule_lock = app_state.schedule.lock().unwrap();
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
pub mod get_cache_status;
|
||||
pub mod get_schedule;
|
||||
pub mod get_group;
|
||||
pub mod get_group_names;
|
||||
pub mod get_teacher;
|
||||
pub mod get_teacher_names;
|
||||
mod cache_status;
|
||||
mod group;
|
||||
mod group_names;
|
||||
mod schedule;
|
||||
mod teacher;
|
||||
mod teacher_names;
|
||||
mod schema;
|
||||
pub mod update_download_url;
|
||||
mod update_download_url;
|
||||
|
||||
pub use cache_status::*;
|
||||
pub use group::*;
|
||||
pub use group_names::*;
|
||||
pub use schedule::*;
|
||||
pub use teacher::*;
|
||||
pub use teacher_names::*;
|
||||
pub use update_download_url::*;
|
||||
|
||||
@@ -9,7 +9,7 @@ use actix_web::{get, web};
|
||||
(status = SERVICE_UNAVAILABLE, body = ResponseError<ErrorCode>)
|
||||
))]
|
||||
#[get("/")]
|
||||
pub async fn get_schedule(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
pub async fn schedule(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
match ScheduleView::try_from(&app_state) {
|
||||
Ok(res) => Ok(res).into(),
|
||||
Err(e) => match e {
|
||||
@@ -23,7 +23,7 @@ use actix_web::{get, web};
|
||||
),
|
||||
))]
|
||||
#[get("/teacher/{name}")]
|
||||
pub async fn get_teacher(
|
||||
pub async fn teacher(
|
||||
name: web::Path<String>,
|
||||
app_state: web::Data<AppState>,
|
||||
) -> ServiceResponse {
|
||||
@@ -9,7 +9,7 @@ use actix_web::{get, web};
|
||||
(status = SERVICE_UNAVAILABLE, body = ResponseError<ErrorCode>),
|
||||
))]
|
||||
#[get("/teacher-names")]
|
||||
pub async fn get_teacher_names(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
pub async fn teacher_names(app_state: web::Data<AppState>) -> ServiceResponse {
|
||||
// Prevent thread lock
|
||||
let schedule_lock = app_state.schedule.lock().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user