15 lines
594 B
Rust
15 lines
594 B
Rust
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)
|
|
}))
|
|
} |