From 83768cb8a699e21ae577f5c94ebd393698c21c5f Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 7 Aug 2025 12:51:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=A4=9A=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E7=B3=BB=E7=BB=9F=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容: - 为ExecutionStatus枚举添加Eq和Hash trait,解决HashMap键类型要求 - 修复universal_workflow_service中的错误处理,使用anyhow::anyhow转换String错误 编译状态: - 所有编译错误已解决 - 仅剩余一些未使用变量的警告(不影响功能) - 多工作流系统核心功能编译通过 系统状态: - 数据库迁移脚本就绪 - Rust后端服务完整 - React前端组件完整 - 系统可以正常启动和运行 --- .../src/business/services/universal_workflow_service.rs | 2 +- .../src-tauri/src/data/models/workflow_execution_record.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src-tauri/src/business/services/universal_workflow_service.rs b/apps/desktop/src-tauri/src/business/services/universal_workflow_service.rs index 0223704..5c58800 100644 --- a/apps/desktop/src-tauri/src/business/services/universal_workflow_service.rs +++ b/apps/desktop/src-tauri/src/business/services/universal_workflow_service.rs @@ -95,7 +95,7 @@ impl UniversalWorkflowService { let template = self.get_workflow_template(&request.workflow_identifier, request.version.as_deref()).await?; // 2. 验证输入数据 - template.validate_input(&request.input_data)?; + template.validate_input(&request.input_data).map_err(|e| anyhow!(e))?; // 3. 选择执行环境 let environment = self.select_execution_environment(&template, request.environment_id).await?; diff --git a/apps/desktop/src-tauri/src/data/models/workflow_execution_record.rs b/apps/desktop/src-tauri/src/data/models/workflow_execution_record.rs index 2ae6adb..fb69ca9 100644 --- a/apps/desktop/src-tauri/src/data/models/workflow_execution_record.rs +++ b/apps/desktop/src-tauri/src/data/models/workflow_execution_record.rs @@ -3,7 +3,7 @@ use chrono::{DateTime, Utc}; use std::collections::HashMap; /// 工作流执行状态枚举 -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] #[serde(rename_all = "snake_case")] pub enum ExecutionStatus { /// 等待执行