将 checkpoint、异步任务与段结果缓存的唯一键从 execution_id 改为 node_group_id,区分换参重跑与续跑语义;恢复/续跑复用执行记录的组标识,换参重跑则换新组并软删旧组残留,消除软删墓碑导致同键重存失效的问题。
44 lines
1.8 KiB
Go
44 lines
1.8 KiB
Go
package entity
|
||
|
||
import "gitea.redpowerfuture.com/red-future/common/beans"
|
||
|
||
// FlowSegmentResult 视频节点段级生成结果(只存成功段),供断点续跑复用
|
||
type FlowSegmentResult struct {
|
||
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, TenantId, Creator, CreatedAt, Updater, UpdatedAt, DeletedAt
|
||
// 业务字段
|
||
// NodeGroupId 所属逻辑运行(attempt)标识:段结果唯一键 (node_group_id, node_id, segment_index),
|
||
// 换参重跑换组即换键,绝不复用被软删墓碑的旧组行(软删即终态,不复活)
|
||
NodeGroupId string `orm:"node_group_id" json:"nodeGroupId" description:"所属逻辑运行(node_group_id)标识"`
|
||
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:"段序号"`
|
||
VideoKey string `orm:"video_key" json:"videoKey" description:"视频输出字段key"`
|
||
VideoURL string `orm:"video_url" json:"videoURL" description:"已生成成功的视频地址"`
|
||
}
|
||
|
||
// SegmentRef 一段已成功生成的视频引用(Key 保持模型原输出字段名,重建输出记录保证下游引用一致)
|
||
type SegmentRef struct {
|
||
Key string
|
||
URL string
|
||
}
|
||
|
||
type flowSegmentResultCol struct {
|
||
beans.SQLBaseCol
|
||
NodeGroupId string
|
||
ExecutionId string
|
||
NodeId string
|
||
SegmentIndex string
|
||
VideoKey string
|
||
VideoURL string
|
||
}
|
||
|
||
var FlowSegmentResultCol = flowSegmentResultCol{
|
||
SQLBaseCol: beans.DefSQLBaseCol,
|
||
NodeGroupId: "node_group_id",
|
||
ExecutionId: "execution_id",
|
||
NodeId: "node_id",
|
||
SegmentIndex: "segment_index",
|
||
VideoKey: "video_key",
|
||
VideoURL: "video_url",
|
||
}
|