17 lines
391 B
Rust
17 lines
391 B
Rust
|
|
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)
|
||
|
|
}
|