feat(workflow): flow_async_task 统一异步任务表实体与 DAO(物理删除)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package entity
|
||||
|
||||
import "gitea.redpowerfuture.com/red-future/common/beans"
|
||||
|
||||
// FlowAsyncTask 统一异步模型任务表:提交时写入(in-flight),结果回来更新;
|
||||
// 崩溃恢复靠持久化的 msg_topic 重订阅 NATS 拿回结果,避免重复调用模型
|
||||
type FlowAsyncTask struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
ExecutionId int64 `orm:"execution_id" json:"executionId" description:"所属执行ID"`
|
||||
NodeId string `orm:"node_id" json:"nodeId" description:"所属节点ID"`
|
||||
SegmentIndex int `orm:"segment_index" json:"segmentIndex" description:"段序号;非段调用为-1"`
|
||||
ModelId int64 `orm:"model_id" json:"modelId" description:"模型ID"`
|
||||
TaskId int64 `orm:"task_id" json:"taskId" description:"model-gateway任务ID"`
|
||||
MsgTopic string `orm:"msg_topic" json:"msgTopic" description:"结果消息主题"`
|
||||
State int `orm:"state" json:"state" description:"0=in-flight,1=done,2=failed"`
|
||||
Result string `orm:"result" json:"result" description:"成功结果JSON(ModelCallRes)"`
|
||||
}
|
||||
|
||||
type flowAsyncTaskCol struct {
|
||||
beans.SQLBaseCol
|
||||
ExecutionId string
|
||||
NodeId string
|
||||
SegmentIndex string
|
||||
ModelId string
|
||||
TaskId string
|
||||
MsgTopic string
|
||||
State string
|
||||
Result string
|
||||
}
|
||||
|
||||
var FlowAsyncTaskCol = flowAsyncTaskCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
ExecutionId: "execution_id",
|
||||
NodeId: "node_id",
|
||||
SegmentIndex: "segment_index",
|
||||
ModelId: "model_id",
|
||||
TaskId: "task_id",
|
||||
MsgTopic: "msg_topic",
|
||||
State: "state",
|
||||
Result: "result",
|
||||
}
|
||||
Reference in New Issue
Block a user