Fix: 优化 SQL 库启动加载
Co-authored-by: staff <staff@qimaos-MacBook-Pro.local>
This commit is contained in:
1 parent
c289dda97d
commit
b85b14bfde
18 files changed
+397
-42
No files matched your search
@@ -8,10 +8,18 @@ use crate::error::AppError;
|
||||
use crate::state::WebState;
|
||||
|
||||
pub async fn load_saved_sql_library(State(state): State<Arc<WebState>>) -> Result<Json<SavedSqlLibrary>, AppError> {
|
||||
let library = state.app.storage.load_saved_sql_library().await.map_err(AppError)?;
|
||||
let library = state.app.storage.load_saved_sql_library_summary().await.map_err(AppError)?;
|
||||
Ok(Json(library))
|
||||
}
|
||||
|
||||
pub async fn load_saved_sql_file(
|
||||
State(state): State<Arc<WebState>>,
|
||||
Path(id): Path<String>,
|
||||
) -> Result<Json<Option<SavedSqlFile>>, AppError> {
|
||||
let file = state.app.storage.load_saved_sql_file(&id).await.map_err(AppError)?;
|
||||
Ok(Json(file))
|
||||
}
|
||||
|
||||
pub async fn save_saved_sql_folder(
|
||||
State(state): State<Arc<WebState>>,
|
||||
Json(folder): Json<SavedSqlFolder>,
|
||||
|
||||
Reference in new issue
Block a user