refactor(agent, shipping): 简化代理模型并完善订单抽取业务

- 移除 Agent 的 exposure_mode 与 internal_executor 相关逻辑,清理关联的过滤、序列化代码
- 删除废弃的 AgentRuntimeBinding 模型及其依赖
- 新增订单抽取上传批次、请求快照等数据库迁移与业务逻辑
- 修复附件完整性检测、订单抽取状态映射问题
- 更新多语言错误文案与前端单元测试配置
- 清理平台配置中不再使用的暴露模式配置
This commit is contained in:
hugo committed 2026-07-28 20:25:48 +08:00
1 parent 1f3ecb87b7
commit 61ac6403c4
159 files changed
+12883 -5099

No files matched your search

+1 -6
View File
@@ -11,7 +11,7 @@ from __future__ import annotations
from datetime import datetime
from typing import List, Optional
from sqlalchemy import Boolean, CheckConstraint, DateTime, ForeignKey, Integer, Index, JSON, String, Text, UniqueConstraint, text
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, Index, JSON, String, Text, UniqueConstraint, text
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.models.base import Base, user_agent_permissions
@@ -26,10 +26,6 @@ class Agent(Base):
__tablename__ = 'agents'
__table_args__ = (
CheckConstraint(
"exposure_mode IN ('workspace', 'internal')",
name='ck_agents_exposure_mode',
),
Index('uq_agents_one_active_shipping_notice', 'agent_code', unique=True,
postgresql_where=text("agent_code = 'shipping_notice' AND is_active = true"),
sqlite_where=text("agent_code = 'shipping_notice' AND is_active = 1")),
@@ -53,7 +49,6 @@ class Agent(Base):
runtime_provider: Mapped[str] = mapped_column(String(32), default='dify', nullable=False)
conversation_mode: Mapped[str] = mapped_column(String(32), default='chat', nullable=False)
dify_app_type: Mapped[str] = mapped_column(String(20), default='chatflow', nullable=False)
exposure_mode: Mapped[str] = mapped_column(String(20), default='workspace', nullable=False)
iframe_url: Mapped[Optional[str]] = mapped_column(String(500), nullable=True)
category: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)
sub_category: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)