refactor(agent, shipping): 简化代理模型并完善订单抽取业务
- 移除 Agent 的 exposure_mode 与 internal_executor 相关逻辑,清理关联的过滤、序列化代码 - 删除废弃的 AgentRuntimeBinding 模型及其依赖 - 新增订单抽取上传批次、请求快照等数据库迁移与业务逻辑 - 修复附件完整性检测、订单抽取状态映射问题 - 更新多语言错误文案与前端单元测试配置 - 清理平台配置中不再使用的暴露模式配置
This commit is contained in:
1 parent
1f3ecb87b7
commit
61ac6403c4
159 files changed
+12883
-5099
No files matched your search
@@ -20,7 +20,6 @@ from app import db
|
||||
from app.core.config.env_persistence import persist_env_settings
|
||||
from app.core.errors import AppError, ConflictError, NotFoundError, ValidationError
|
||||
from app.models import Agent, LoginAudit, User, WecomNotifyAudit
|
||||
from app.services.agent_user_access import load_grantable_agents
|
||||
from app.services.auth import wecom_auth_service
|
||||
from app.services.oa_wecom_sync import sync_wecom_userids_from_oa
|
||||
|
||||
@@ -314,11 +313,10 @@ def provision_user(data: dict[str, Any]) -> tuple[dict, int]:
|
||||
except (TypeError, ValueError):
|
||||
db.session.rollback()
|
||||
raise ValidationError('agent_ids must be integer array')
|
||||
try:
|
||||
agents = load_grantable_agents(unique_ids)
|
||||
except ValidationError:
|
||||
agents = db.session.query(Agent).filter(Agent.id.in_(unique_ids)).all()
|
||||
if len(agents) != len(unique_ids):
|
||||
db.session.rollback()
|
||||
raise
|
||||
raise ValidationError('Some agent_ids are invalid')
|
||||
user.agents = agents
|
||||
else:
|
||||
user.agents = []
|
||||
|
||||
Reference in new issue
Block a user