feat: 新增创作作品管理模块及相关配置

This commit is contained in:
2026-05-08 11:35:15 +08:00
parent ed333dd15c
commit 74ede5bc0f
16 changed files with 1373 additions and 4 deletions

View File

@@ -228,3 +228,133 @@ COMMENT ON COLUMN digital_human_async_task_ref.table_name IS '业务表名';
COMMENT ON COLUMN digital_human_async_task_ref.biz_id IS '业务表主键ID';
COMMENT ON COLUMN digital_human_async_task_ref.oss_file IS '已转移后的业务侧OSS地址';
COMMENT ON COLUMN digital_human_async_task_ref.error_msg IS '错误信息';
-- =============================================================
-- 低代码流程编排平台 - 数据库表结构
-- Author: AI Assistant
-- =============================================================
-- 素材/创作信息表
CREATE TABLE IF NOT EXISTS black_deacon_creation_info (
-- 基础字段(完全对齐项目规范)
id BIGINT PRIMARY KEY, -- 主键ID非自增
tenant_id BIGINT NOT NULL DEFAULT 0, -- 租户ID int8
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),
-- 业务字段
html_file_url VARCHAR(512) DEFAULT '', -- HTML文件地址
image_urls TEXT[] DEFAULT '{}', -- 图片地址列表
content_type VARCHAR(255) DEFAULT '', -- 素材类型
theme VARCHAR(255) DEFAULT '', -- 主题
title VARCHAR(255) NOT NULL -- 标题
);
-- 索引(高频查询)
CREATE INDEX idx_creation_tenant_id ON black_deacon_creation_info(tenant_id);
CREATE INDEX idx_creation_content_type ON black_deacon_creation_info(content_type);
CREATE INDEX idx_creation_theme ON black_deacon_creation_info(theme);
CREATE INDEX idx_creation_title ON black_deacon_creation_info(title);
CREATE INDEX idx_creation_deleted_at ON black_deacon_creation_info(deleted_at);
-- 表和字段注释
COMMENT ON TABLE black_deacon_creation_info IS '素材/创作信息表';
COMMENT ON COLUMN black_deacon_creation_info.id IS '主键ID非自增';
COMMENT ON COLUMN black_deacon_creation_info.tenant_id IS '租户ID';
COMMENT ON COLUMN black_deacon_creation_info.creator IS '创建人';
COMMENT ON COLUMN black_deacon_creation_info.created_at IS '创建时间';
COMMENT ON COLUMN black_deacon_creation_info.updater IS '更新人';
COMMENT ON COLUMN black_deacon_creation_info.updated_at IS '更新时间';
COMMENT ON COLUMN black_deacon_creation_info.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN black_deacon_creation_info.html_file_url IS 'HTML文件地址';
COMMENT ON COLUMN black_deacon_creation_info.image_urls IS '图片地址列表';
COMMENT ON COLUMN black_deacon_creation_info.content_type IS '素材类型';
COMMENT ON COLUMN black_deacon_creation_info.theme IS '主题';
COMMENT ON COLUMN black_deacon_creation_info.title IS '标题';
--------------------pgsql创建creation_info表语句---------------------------
--------------------pgsql创建black_deacon_flow_execution表语句---------------------------
-- 流程执行记录表
CREATE TABLE IF NOT EXISTS black_deacon_flow_execution (
-- 基础字段(完全对齐项目规范)
id BIGINT PRIMARY KEY, -- 主键ID非自增
tenant_id BIGINT NOT NULL DEFAULT 0, -- 租户ID int8
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),
-- 业务字段
flow_user_id BIGINT NOT NULL, -- 流程ID
trigger_type VARCHAR(32) NOT NULL DEFAULT '', -- 触发类型
duration_ms BIGINT NOT NULL DEFAULT 0, -- 执行时长(毫秒)
status SMALLINT NOT NULL DEFAULT 1, -- 状态:1-运行中,2-成功,3-失败
flow_content JSONB DEFAULT '{}', -- 流程模板内容
node_input_params JSONB DEFAULT '[]'::JSONB,
output_params JSONB DEFAULT '[]'::JSONB,
error_message TEXT DEFAULT '', -- 错误信息
trace_id VARCHAR(64) DEFAULT '' -- 跟踪ID
);
-- 索引(高频查询)
CREATE INDEX idx_bfe_tenant_id ON black_deacon_flow_execution(tenant_id);
CREATE INDEX idx_bfe_flow_user_id ON black_deacon_flow_execution(flow_user_id);
CREATE INDEX idx_bfe_trace_id ON black_deacon_flow_execution(trace_id);
CREATE INDEX idx_bfe_status ON black_deacon_flow_execution(status);
CREATE INDEX idx_bfe_deleted_at ON black_deacon_flow_execution(deleted_at);
-- 表和字段注释
COMMENT ON TABLE black_deacon_flow_execution IS '流程执行记录表';
COMMENT ON COLUMN black_deacon_flow_execution.id IS '主键ID非自增';
COMMENT ON COLUMN black_deacon_flow_execution.tenant_id IS '租户ID';
COMMENT ON COLUMN black_deacon_flow_execution.creator IS '创建人';
COMMENT ON COLUMN black_deacon_flow_execution.created_at IS '创建时间';
COMMENT ON COLUMN black_deacon_flow_execution.updater IS '更新人';
COMMENT ON COLUMN black_deacon_flow_execution.updated_at IS '更新时间';
COMMENT ON COLUMN black_deacon_flow_execution.deleted_at IS '删除时间(软删)';
COMMENT ON COLUMN black_deacon_flow_execution.flow_user_id IS '流程ID';
COMMENT ON COLUMN black_deacon_flow_execution.trigger_type IS '触发类型';
COMMENT ON COLUMN black_deacon_flow_execution.duration_ms IS '执行时长(毫秒)';
COMMENT ON COLUMN black_deacon_flow_execution.status IS '状态:1-运行中,2-成功,3-失败';
COMMENT ON COLUMN black_deacon_flow_execution.flow_content IS '流程模板内容';
COMMENT ON COLUMN black_deacon_flow_execution.node_input_params IS '节点输入参数';
COMMENT ON COLUMN black_deacon_flow_execution.output_params IS '输出参数';
COMMENT ON COLUMN black_deacon_flow_execution.error_message IS '错误信息';
COMMENT ON COLUMN black_deacon_flow_execution.trace_id IS '跟踪ID';
--------------------pgsql创建black_deacon_flow_execution表语句---------------------------
--------------------pgsql创建black_deacon_flow_user表语句---------------------------
-- 用户流程表
CREATE TABLE IF NOT EXISTS black_deacon_flow_user (
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),
flow_name VARCHAR(128) NOT NULL DEFAULT '',
description TEXT DEFAULT '',
flow_content JSONB DEFAULT '{}',
node_input_params JSONB DEFAULT '[]'::JSONB,
access_level VARCHAR(32) NOT NULL DEFAULT '1',
source_flow_template_id BIGINT NOT NULL DEFAULT 0
);
CREATE INDEX idx_flow_user_tenant ON black_deacon_flow_user(tenant_id);
COMMENT ON TABLE black_deacon_flow_user IS '用户流程表';
COMMENT ON COLUMN black_deacon_flow_user.flow_name IS '流程名称';
COMMENT ON COLUMN black_deacon_flow_user.description IS '流程描述';
COMMENT ON COLUMN black_deacon_flow_user.flow_content IS '流程内容';
COMMENT ON COLUMN black_deacon_flow_user.node_input_params IS '节点输入参数';
COMMENT ON COLUMN black_deacon_flow_user.access_level IS '访问权限1私有2团队3公开';
COMMENT ON COLUMN black_deacon_flow_user.source_flow_template_id IS '来源流程模板ID';
--------------------pgsql创建black_deacon_flow_user表语句---------------------------