- Initialize database on app startup with migration from JSON config - Update AppState to include Database instance alongside MultiAppConfig - Simplify store module by removing unused session management code - Add database initialization to app setup flow - Support both database and legacy config during transition
15 lines
248 B
Rust
15 lines
248 B
Rust
use crate::database::Database;
|
|
use std::sync::Arc;
|
|
|
|
/// 全局应用状态
|
|
pub struct AppState {
|
|
pub db: Arc<Database>,
|
|
}
|
|
|
|
impl AppState {
|
|
/// 创建新的应用状态
|
|
pub fn new(db: Arc<Database>) -> Self {
|
|
Self { db }
|
|
}
|
|
}
|