ai-refactor(flow): 调整抽象流程节点实现和依赖路径

- 修改 AbstractProcessNode 中 ProcessContext 的命名空间引用为 app\flow\context\ProcessContext
- 引入 app\flow\vo\CanHandleResult 用于节点处理结果表示
- 更新前置策略执行后对成功状态的判断,改为调用 isSuccess() 方法
- 增加日志记录细节,便于调试策略执行中断时的错误信息
- 优化代码注释,提升代码可读性和维护性
This commit is contained in:
zimoyin
2026-03-11 00:49:02 +08:00
parent e040fccba6
commit d5991813a6
14 changed files with 1755 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace app\flow\vo;
/**
* 操作员信息值对象
* 封装操作员的基础信息,不可变对象
*/
readonly class OperatorInfo
{
public function __construct(
/** 操作员ID */
public string $id = '',
/** 操作员姓名 */
public string $name = '',
/** 操作员RFID卡号 */
public string $rfid = '',
) {}
/**
* 创建空的操作员信息
*/
public static function empty(): self
{
return new self();
}
/**
* 判断操作员信息是否为空
*/
public function isEmpty(): bool
{
return empty($this->id);
}
/**
* 判断操作员信息是否完整有效
*/
public function isValid(): bool
{
return !empty($this->id) && !empty($this->name) && !empty($this->rfid);
}
/**
* 转换为数组
*/
public function toArray(): array
{
return [
'id' => $this->id,
'name' => $this->name,
'rfid' => $this->rfid,
];
}
}