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:
23
src/routes/schedule/cache_status.rs
Normal file
23
src/routes/schedule/cache_status.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use crate::AppState;
|
||||
use crate::routes::schedule::schema::CacheStatus;
|
||||
use actix_web::{get, web};
|
||||
|
||||
#[utoipa::path(responses(
|
||||
(status = OK, body = CacheStatus),
|
||||
))]
|
||||
#[get("/cache-status")]
|
||||
pub async fn cache_status(app_state: web::Data<AppState>) -> CacheStatus {
|
||||
// Prevent thread lock
|
||||
let has_schedule = app_state
|
||||
.schedule
|
||||
.lock()
|
||||
.as_ref()
|
||||
.map(|res| res.is_some())
|
||||
.unwrap();
|
||||
|
||||
match has_schedule {
|
||||
true => CacheStatus::from(&app_state),
|
||||
false => CacheStatus::default(),
|
||||
}
|
||||
.into()
|
||||
}
|
||||
Reference in New Issue
Block a user