update
This commit is contained in:
15
src/routes/pipeline.rs
Normal file
15
src/routes/pipeline.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use crate::db::Database;
|
||||
use crate::engine::pipeline;
|
||||
use actix_web::{HttpResponse, Responder, web};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// POST /api/pipeline/run — 处理所有相册元数据(提取人名+标签)
|
||||
pub async fn pipeline_run(db: web::Data<Arc<Database>>) -> impl Responder {
|
||||
let (persons, tags) = pipeline::process_all_albums(db.get_ref()).await;
|
||||
HttpResponse::Ok().json(serde_json::json!({
|
||||
"success": true,
|
||||
"persons_updated": persons,
|
||||
"tags_updated": tags,
|
||||
"message": format!("处理完成:{} 个人名,{} 个标签", persons, tags)
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user