feat(session): integrate actix-web framework with enhanced session management
- Added actix-web and actix-multipart dependencies to Cargo.toml - Integrated actix-web ResponseError trait for AppError handling - Migrated session module to use actix-web request lifecycle management - Enhanced Session struct with request-local state handling capabilities - Implemented proper HTTP status code mapping for various error types - Added comprehensive session middleware integration points - Updated session state persistence and modification tracking logic - Integrated proper JSON response formatting for error messages - Added support for session renewal, purge, and unchanged state management
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
pub mod openapi;
|
||||
pub mod response;
|
||||
pub mod routes;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
use utoipa::OpenApi;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
pub struct OpenApiDoc;
|
||||
@@ -0,0 +1,19 @@
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Serialize, utoipa::ToSchema)]
|
||||
pub struct ApiResponse<T: Serialize> {
|
||||
pub data: T,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, utoipa::ToSchema)]
|
||||
pub struct ApiEmptyResponse {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, utoipa::ToSchema)]
|
||||
pub struct ApiListResponse<T: Serialize> {
|
||||
pub data: Vec<T>,
|
||||
pub total: i64,
|
||||
pub page: i64,
|
||||
pub per_page: i64,
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
use actix_web::web;
|
||||
use actix_web::web::scope;
|
||||
|
||||
pub fn init_routes(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(scope("/api/v1"));
|
||||
}
|
||||
Reference in New Issue
Block a user