feat(flow): 重构流程引擎与任务执行器架构

重构流程引擎核心组件,引入执行器接口Executor替代原有TaskComponent,优化节点配置映射逻辑:
1. 新增mappers模块集中处理节点配置提取
2. 为存储层添加Storage trait抽象
3. 移除对ctx魔法字段的依赖,直接传递节点信息
4. 增加构建器模式支持引擎创建
5. 完善DSL解析的输入校验

同时标记部分未使用代码为allow(dead_code)
This commit is contained in:
2025-09-16 23:58:28 +08:00
parent 65764a2cbc
commit 81757eecf5
13 changed files with 375 additions and 164 deletions

View File

@ -61,6 +61,7 @@ impl RedisHelper {
}
/// 删除键
#[allow(dead_code)]
pub async fn del(key: &str) -> Result<(), AppError> {
let mut conn = get_redis()?.clone();
let _: i32 = conn.del(key).await
@ -69,6 +70,7 @@ impl RedisHelper {
}
/// 检查键是否存在
#[allow(dead_code)]
pub async fn exists(key: &str) -> Result<bool, AppError> {
let mut conn = get_redis()?.clone();
let result: bool = conn.exists(key).await
@ -77,6 +79,7 @@ impl RedisHelper {
}
/// 设置键的过期时间
#[allow(dead_code)]
pub async fn expire(key: &str, seconds: u64) -> Result<(), AppError> {
let mut conn = get_redis()?.clone();
let _: bool = conn.expire(key, seconds as i64).await
@ -136,12 +139,14 @@ impl TokenRedis {
}
/// 删除用户的访问token
#[allow(dead_code)]
pub async fn revoke_access_token(user_id: i64) -> Result<(), AppError> {
let key = format!("token:access:user:{}", user_id);
RedisHelper::del(&key).await
}
/// 删除用户的刷新token
#[allow(dead_code)]
pub async fn revoke_refresh_token(user_id: i64) -> Result<(), AppError> {
let key = format!("token:refresh:user:{}", user_id);
RedisHelper::del(&key).await