1. 管理后台支持为不同 Agent 应用上传和管理视频、PDF 等新手指南资料。
2. 前端聊天界面根据后台配置,动态展示“新手指南”入口。
3. 用户点击后可直接在系统内预览视频或 PDF 文档。
This commit is contained in:
runny committed 2026-06-04 12:47:21 +08:00
1 parent cc53d29e76
commit f8de4630a5
19 files changed
+742 -122

No files matched your search

@@ -0,0 +1,74 @@
"""add agent_guides table
Revision ID: f6f91cb46944
Revises: d0e1f2a3b4c5
Create Date: 2026-06-04 09:32:18.390108
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f6f91cb46944'
down_revision = 'd0e1f2a3b4c5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('agent_guides',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('agent_id', sa.Integer(), nullable=False),
sa.Column('file_name', sa.String(length=255), nullable=False),
sa.Column('file_type', sa.String(length=50), nullable=False),
sa.Column('file_path', sa.String(length=500), nullable=False),
sa.Column('file_size', sa.Integer(), nullable=True),
sa.Column('remark', sa.Text(), nullable=True),
sa.Column('sort_order', sa.Integer(), nullable=False),
sa.Column('status', sa.Integer(), nullable=False),
sa.Column('created_by', sa.Integer(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['agent_id'], ['agents.id'], ),
sa.ForeignKeyConstraint(['created_by'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('agent_guides', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_agent_guides_agent_id'), ['agent_id'], unique=False)
with op.batch_alter_table('schedule_runs', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_schedule_runs_id'))
with op.batch_alter_table('schedule_tasks', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_schedule_tasks_id'))
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('uq_users_wecom_unionid'))
batch_op.drop_index(batch_op.f('uq_users_wecom_userid'))
batch_op.create_unique_constraint(None, ['wecom_unionid'])
batch_op.create_unique_constraint(None, ['wecom_userid'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='unique')
batch_op.drop_constraint(None, type_='unique')
batch_op.create_index(batch_op.f('uq_users_wecom_userid'), ['wecom_userid'], unique=True)
batch_op.create_index(batch_op.f('uq_users_wecom_unionid'), ['wecom_unionid'], unique=True)
with op.batch_alter_table('schedule_tasks', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_schedule_tasks_id'), ['id'], unique=False)
with op.batch_alter_table('schedule_runs', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_schedule_runs_id'), ['id'], unique=False)
with op.batch_alter_table('agent_guides', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_agent_guides_agent_id'))
op.drop_table('agent_guides')
# ### end Alembic commands ###