Refactoring the structure a bit

This commit is contained in:
Dave
2026-02-16 16:24:21 +00:00
parent a2188e2c7f
commit 5923165fcf
21 changed files with 522 additions and 372 deletions

View File

@@ -0,0 +1,16 @@
use crate::state::SessionState;
use crate::store::JsonFileStore;
use poem::http::StatusCode;
use std::sync::Arc;
#[derive(Clone)]
pub struct AppContext {
pub state: Arc<SessionState>,
pub store: Arc<JsonFileStore>,
}
pub type OpenApiResult<T> = poem::Result<T>;
pub fn bad_request(message: String) -> poem::Error {
poem::Error::from_string(message, StatusCode::BAD_REQUEST)
}