diff --git a/apps/desktop/src-tauri/src/business/services/error_handling_service.rs b/apps/desktop/src-tauri/src/business/services/error_handling_service.rs index 0d0319a..4a71c2c 100644 --- a/apps/desktop/src-tauri/src/business/services/error_handling_service.rs +++ b/apps/desktop/src-tauri/src/business/services/error_handling_service.rs @@ -6,7 +6,7 @@ use tracing::{error, warn, info}; use chrono::{DateTime, Utc}; /// 错误严重程度 -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum ErrorSeverity { Low, // 轻微错误,不影响主要功能 Medium, // 中等错误,影响部分功能 @@ -15,7 +15,7 @@ pub enum ErrorSeverity { } /// 错误类别 -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum ErrorCategory { Network, // 网络相关错误 Database, // 数据库相关错误 @@ -159,7 +159,7 @@ impl ErrorHandlingService { let error_message = error.to_string(); let error_id = self.classify_error(&error_message); - let mut user_error = if let Some(template) = self.error_templates.get(&error_id) { + let user_error = if let Some(template) = self.error_templates.get(&error_id) { let mut error = template.clone(); error.timestamp = Utc::now(); if let Some(ctx) = context { diff --git a/apps/desktop/src-tauri/src/business/services/outfit_photo_generation_service.rs b/apps/desktop/src-tauri/src/business/services/outfit_photo_generation_service.rs index 44fc3eb..3c6706b 100644 --- a/apps/desktop/src-tauri/src/business/services/outfit_photo_generation_service.rs +++ b/apps/desktop/src-tauri/src/business/services/outfit_photo_generation_service.rs @@ -32,7 +32,7 @@ impl OutfitPhotoGenerationService { cloud_upload_service: Arc, ) -> Result { let repository = OutfitPhotoGenerationRepository::new(database.clone())?; - let model_repository = ModelRepository::new(database)?; + let model_repository = ModelRepository::new(database); Ok(Self { repository, diff --git a/apps/desktop/src-tauri/src/business/services/workflow_management_service.rs b/apps/desktop/src-tauri/src/business/services/workflow_management_service.rs index 34e2a33..c998809 100644 --- a/apps/desktop/src-tauri/src/business/services/workflow_management_service.rs +++ b/apps/desktop/src-tauri/src/business/services/workflow_management_service.rs @@ -4,7 +4,7 @@ use serde_json::Value; use std::collections::HashMap; use std::path::{Path, PathBuf}; use tokio::fs; -use tracing::{info, warn, error}; +use tracing::{info, warn}; /// 工作流元数据 #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/apps/desktop/src-tauri/src/presentation/commands/error_handling_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/error_handling_commands.rs index cf8c712..64f68d3 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/error_handling_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/error_handling_commands.rs @@ -127,6 +127,7 @@ pub async fn handle_and_record_error( let service = ErrorHandlingService::new(); // 创建一个简单的错误实现 + #[derive(Debug)] struct SimpleError(String); impl std::fmt::Display for SimpleError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -156,6 +157,7 @@ pub async fn get_error_suggestions( let service = ErrorHandlingService::new(); // 创建一个简单的错误实现 + #[derive(Debug)] struct SimpleError(String); impl std::fmt::Display for SimpleError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -185,6 +187,7 @@ pub async fn check_error_retry_capability( let service = ErrorHandlingService::new(); // 创建一个简单的错误实现 + #[derive(Debug)] struct SimpleError(String); impl std::fmt::Display for SimpleError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -221,6 +224,7 @@ pub async fn get_error_help_info( let service = ErrorHandlingService::new(); // 创建一个简单的错误实现 + #[derive(Debug)] struct SimpleError(String); impl std::fmt::Display for SimpleError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 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 0b633ff..9a60866 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 @@ -1,7 +1,7 @@ use tauri::State; use crate::app_state::AppState; use crate::data::models::outfit_image::{ - OutfitImageRecord, OutfitImageGenerationRequest, + OutfitImageRecord, OutfitImageGenerationRequest, OutfitImageGenerationResponse, OutfitImageStats, ProductImage }; use crate::data::repositories::outfit_image_repository::OutfitImageRepository;