2026-02-16 16:24:21 +00:00
|
|
|
use crate::state::SessionState;
|
|
|
|
|
use crate::store::JsonFileStore;
|
2026-02-19 12:54:04 +00:00
|
|
|
use crate::workflow::WorkflowState;
|
2026-02-16 16:24:21 +00:00
|
|
|
use poem::http::StatusCode;
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
|
pub struct AppContext {
|
|
|
|
|
pub state: Arc<SessionState>,
|
|
|
|
|
pub store: Arc<JsonFileStore>,
|
2026-02-19 12:54:04 +00:00
|
|
|
pub workflow: Arc<std::sync::Mutex<WorkflowState>>,
|
2026-02-16 16:24:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub type OpenApiResult<T> = poem::Result<T>;
|
|
|
|
|
|
|
|
|
|
pub fn bad_request(message: String) -> poem::Error {
|
|
|
|
|
poem::Error::from_string(message, StatusCode::BAD_REQUEST)
|
|
|
|
|
}
|