feat(shipping-notice): 增强订单抽取功能,添加进度事件和诊断运行管理,优化数据模型和访问控制
This commit is contained in:
1 parent
ce26d6d0c4
commit
c4095b08da
175 files changed
+13064
-1814
No files matched your search
@@ -13,6 +13,7 @@ from app.core.auth.jwt import get_current_user
|
||||
from app.core.errors import UnauthorizedError
|
||||
from app.models import Agent, User, AgentGuide
|
||||
from app.services.agent_category import serialize_agent_list_item, sort_agent_rows
|
||||
from app.services.agent_user_access import require_user_application_access
|
||||
from app.services.minio_service import minio_service
|
||||
|
||||
# 定义 Blueprint,将在应用工厂中注册为 /api/agents
|
||||
@@ -65,7 +66,9 @@ def list_agent_guides(agent_id):
|
||||
获取指定应用的新手指南列表 (需登录)
|
||||
用途:客户端 Chat 界面点击新手指南
|
||||
"""
|
||||
get_current_user() # 确保已登录
|
||||
user = get_current_user()
|
||||
if not user:
|
||||
raise UnauthorizedError()
|
||||
|
||||
if agent_id == 0:
|
||||
generic_agent = (
|
||||
@@ -79,6 +82,9 @@ def list_agent_guides(agent_id):
|
||||
else:
|
||||
return jsonify([])
|
||||
|
||||
agent = db.session.get(Agent, agent_id)
|
||||
require_user_application_access(agent, user)
|
||||
|
||||
guides = (
|
||||
db.session.query(AgentGuide)
|
||||
.filter_by(agent_id=agent_id, status=1)
|
||||
@@ -108,7 +114,7 @@ def list_public_agents():
|
||||
"""
|
||||
agents = (
|
||||
db.session.query(Agent)
|
||||
.filter(Agent.is_active.is_(True))
|
||||
.filter(Agent.is_active.is_(True), Agent.exposure_mode == 'workspace')
|
||||
.order_by(Agent.id.asc())
|
||||
.all()
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user