diff --git a/apps/desktop/src-tauri/src/data/repositories/model_repository.rs b/apps/desktop/src-tauri/src/data/repositories/model_repository.rs index f10dde3..0030a6b 100644 --- a/apps/desktop/src-tauri/src/data/repositories/model_repository.rs +++ b/apps/desktop/src-tauri/src/data/repositories/model_repository.rs @@ -95,13 +95,11 @@ impl ModelRepository { /// 根据ID获取模特 /// 使用读写分离避免嵌套锁问题 pub fn get_by_id(&self, id: &str) -> Result> { - println!("get_by_id 开始执行,model_id: {}", id); // 首先获取模特基本信息(使用只读连接) let model = { match self.database.try_get_read_connection() { Some(conn) => { - println!("get_by_id 使用只读连接获取基本信息"); let mut stmt = conn.prepare( "SELECT id, name, stage_name, gender, age, height, weight, measurements, @@ -129,12 +127,9 @@ impl ModelRepository { // 如果找到模特,加载照片信息(此时已释放了基本信息查询的锁) if let Some(mut model) = model { - println!("get_by_id 开始加载照片信息"); model.photos = self.get_photos(&model.id)?; - println!("get_by_id 执行完成"); Ok(Some(model)) } else { - println!("get_by_id 未找到模特"); Ok(None) } } @@ -498,7 +493,6 @@ impl ModelRepository { /// 获取模特照片 /// 使用专用只读连接,避免与写操作的锁竞争 pub fn get_photos(&self, model_id: &str) -> Result> { - println!("get_photos 开始执行,model_id: {}", model_id); // 使用专用的只读连接,避免与写操作竞争 match self.database.get_best_read_connection() { @@ -517,7 +511,6 @@ impl ModelRepository { /// 执行照片查询的具体实现 fn execute_photo_query(&self, conn: &Connection, model_id: &str) -> Result> { - println!("get_photos 开始准备SQL语句"); let mut stmt = conn.prepare( "SELECT id, model_id, file_path, file_name, file_size, photo_type, @@ -527,7 +520,6 @@ impl ModelRepository { println!("get_photos SQL 语句准备成功"); let photo_iter = stmt.query_map([model_id], |row| self.row_to_photo(row))?; - println!("get_photos 查询执行成功"); let mut photos = Vec::new(); for (index, photo_result) in photo_iter.enumerate() { @@ -545,7 +537,6 @@ impl ModelRepository { } } - println!("get_photos 查询处理完成,共 {} 张照片", photos.len()); Ok(photos) } @@ -735,10 +726,7 @@ impl ModelRepository { /// 将数据库行转换为照片对象 fn row_to_photo(&self, row: &Row) -> Result { - println!("row_to_photo 开始执行"); - let photo_type_str: String = row.get("photo_type")?; - println!("row_to_photo 获取 photo_type: {}", photo_type_str); let photo_type: PhotoType = serde_json::from_str(&photo_type_str).map_err(|e| { println!("row_to_photo photo_type 解析失败: {}", e); diff --git a/apps/desktop/src-tauri/src/presentation/commands/outfit_image_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/outfit_image_commands.rs index 353c21a..bfc0551 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/outfit_image_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/outfit_image_commands.rs @@ -44,8 +44,6 @@ pub async fn get_model_dashboard_stats( state: State<'_, AppState>, model_id: String, ) -> Result { - println!("📊 获取模特个人看板统计信息: {}", model_id); - // 获取数据库连接 let database = state.get_database(); let outfit_repo = OutfitImageRepository::new(database.clone()); @@ -118,7 +116,6 @@ pub async fn get_outfit_image_records( let records = outfit_repo.get_records_by_model_id(&model_id) .map_err(|e| format!("获取穿搭图片记录失败: {}", e))?; - println!("✅ 获取到 {} 条穿搭图片记录", records.len()); Ok(records) } @@ -130,7 +127,6 @@ pub async fn get_outfit_image_records_paginated( page: u32, page_size: u32, ) -> Result { - println!("📋 分页获取模特穿搭图片生成记录: {} (页码: {}, 每页: {})", model_id, page, page_size); let database = state.get_database(); let outfit_repo = OutfitImageRepository::new(database); @@ -157,8 +153,6 @@ pub async fn get_outfit_image_records_paginated( has_more, }; - println!("✅ 获取到 {} 条穿搭图片记录 (总数: {}, 还有更多: {})", - response.records.len(), total_count, has_more); Ok(response) } diff --git a/apps/desktop/src/services/outfitImageService.ts b/apps/desktop/src/services/outfitImageService.ts index acfe224..c0ab663 100644 --- a/apps/desktop/src/services/outfitImageService.ts +++ b/apps/desktop/src/services/outfitImageService.ts @@ -18,8 +18,6 @@ export class OutfitImageService { */ static async getModelDashboardStats(modelId: string): Promise { try { - console.log('📊 获取模特个人看板统计信息:', modelId); - const stats = await invoke('get_model_dashboard_stats', { modelId }); @@ -59,7 +57,6 @@ export class OutfitImageService { pageSize: number = 20 ): Promise { try { - console.log('📋 分页获取模特穿搭图片生成记录:', modelId, `页码: ${page}, 每页: ${pageSize}`); const response = await invoke('get_outfit_image_records_paginated', { modelId,