feat: 新增视频段级结果表及 DAO(flow_segment_result)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 10:01:48 +08:00
co-authored by Claude Opus 4.7
parent ac7936829f
commit 035c467a62
5 changed files with 196 additions and 0 deletions
+40
View File
@@ -847,3 +847,43 @@ COMMENT ON COLUMN black_deacon_exec_workflow_result.flow_id IS '工作流ID';
COMMENT ON COLUMN black_deacon_exec_workflow_result.exec_id IS '执行ID';
COMMENT ON COLUMN black_deacon_exec_workflow_result.result_file_url IS '结果文件路径(OSS';
--------------------pgsql创建black_deacon_exec_workflow_result表语句---------------------------
--------------------pgsql创建black_deacon_flow_segment_result表语句---------------------------
-- 视频节点段级生成结果表(只存成功段,断点续跑复用;失败段不落库视为需重新生成)
CREATE TABLE IF NOT EXISTS black_deacon_flow_segment_result (
-- 基础字段(完全对齐项目规范)
id BIGINT PRIMARY KEY,
tenant_id BIGINT NOT NULL DEFAULT 0,
creator VARCHAR(64) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updater VARCHAR(64) NOT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
deleted_at timestamp(6),
-- 业务字段
execution_id BIGINT NOT NULL DEFAULT 0, -- 执行IDexec_workflowreExecute 复用同一条)
node_id VARCHAR(64) NOT NULL DEFAULT '', -- 视频生成节点ID
segment_index INT NOT NULL DEFAULT 0, -- 段序号
video_key VARCHAR(128) NOT NULL DEFAULT '', -- 视频输出字段key(重建输出记录保 key 一致,避免下游引用失配)
video_url VARCHAR(512) NOT NULL DEFAULT '' -- 已生成成功的视频地址
);
-- 唯一键 + 高频查询索引(ListByNode 命中 (execution_id, node_id) 前缀)
CREATE UNIQUE INDEX IF NOT EXISTS uk_segment_result_exec_node_idx ON black_deacon_flow_segment_result(execution_id, node_id, segment_index);
CREATE INDEX IF NOT EXISTS idx_segment_result_tenant_id ON black_deacon_flow_segment_result(tenant_id);
CREATE INDEX IF NOT EXISTS idx_segment_result_deleted_at ON black_deacon_flow_segment_result(deleted_at);
-- 表和字段注释
COMMENT ON TABLE black_deacon_flow_segment_result IS '视频节点段级生成结果表';
COMMENT ON COLUMN black_deacon_flow_segment_result.id IS '主键ID';
COMMENT ON COLUMN black_deacon_flow_segment_result.tenant_id IS '租户ID';
COMMENT ON COLUMN black_deacon_flow_segment_result.creator IS '创建人';
COMMENT ON COLUMN black_deacon_flow_segment_result.created_at IS '创建时间';
COMMENT ON COLUMN black_deacon_flow_segment_result.updater IS '更新人';
COMMENT ON COLUMN black_deacon_flow_segment_result.updated_at IS '更新时间';
COMMENT ON COLUMN black_deacon_flow_segment_result.deleted_at IS '删除时间';
COMMENT ON COLUMN black_deacon_flow_segment_result.execution_id IS '执行ID';
COMMENT ON COLUMN black_deacon_flow_segment_result.node_id IS '视频生成节点ID';
COMMENT ON COLUMN black_deacon_flow_segment_result.segment_index IS '段序号';
COMMENT ON COLUMN black_deacon_flow_segment_result.video_key IS '视频输出字段key';
COMMENT ON COLUMN black_deacon_flow_segment_result.video_url IS '已生成成功的视频地址';
--------------------pgsql创建black_deacon_flow_segment_result表语句---------------------------