Реформат путей к эндпоинтам.

Добавлен экстрактор пользователя с дополнительными полями.

Добавлена связь таблиц User и FCM.

Завершена реализация авторизации с помощью VK ID.

Добавлен эндпоинт fcm/update-callback/{version}.
This commit is contained in:
2025-04-14 22:04:41 +04:00
parent 680419ea78
commit 5b6f5c830f
27 changed files with 406 additions and 106 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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();

View File

@@ -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::*;

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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();