use serde::{Deserialize, Serialize}; /// 推荐请求 #[derive(Debug, Deserialize)] pub struct RecommendQuery { pub q: Option, pub limit: Option, pub context: Option, // 上下文标签(用于共现推荐) } /// 推荐条目(通用) #[derive(Debug, Serialize, Deserialize, Clone)] pub struct RecommendItem { pub value: String, pub label: String, pub score: f64, pub count: Option, pub source: String, // "tag" | "person" | "co-occurrence" | "popular" } /// 推荐响应 #[derive(Debug, Serialize, Deserialize)] pub struct RecommendResponse { pub items: Vec, pub total: usize, pub category: String, // "tags" | "persons" | "related" } /// 标签推荐(带上下文) #[derive(Debug, Serialize, Deserialize)] pub struct TagRecommendation { pub tag: String, pub related_tags: Vec, pub similar_persons: Vec, } /// 热门人物 #[derive(Debug, Serialize, Deserialize)] pub struct PopularPerson { pub name: String, pub display_name: Option, pub total_albums: i64, pub total_images: i64, pub top_tags: Vec, pub aliases: Vec, }