feat: complete customer service safety and handover flow

This commit is contained in:
张胜宇
2026-09-11 16:11:30 +08:00
parent 0059701509
commit ef098e6a4b
30 changed files with 1868 additions and 50 deletions
+22
View File
@@ -19,6 +19,7 @@ from app.api.schemas.admin import (
)
from app.core.contracts import RequestContext
from app.service.admin_service import AdminService
from app.service.customer_service_handover_admin_service import CustomerServiceHandoverAdminService
router = APIRouter(prefix="/api/v1/admin", tags=["platform-admin"],
dependencies=[Depends(enforce_rate_limit)])
@@ -130,3 +131,24 @@ async def audit_records(
) -> dict[str, Any]:
"""审计查询(文档 §9.6 支持游标过滤)。游标非法时返回 `400 INVALID_CURSOR`。"""
return await AdminService().query("audit-records", context, limit=limit, cursor=cursor)
@router.get("/customer-service/handover-tickets")
async def list_customer_service_handover_tickets(
limit: int = Query(default=20, ge=1, le=100),
cursor: str | None = Query(default=None),
context: RequestContext = Depends(build_request_context), # noqa: B008
) -> dict[str, Any]:
"""只读查看客服待转人工队列;不暴露原始会话或处理动作。"""
return await CustomerServiceHandoverAdminService().list_tickets(
context, limit=limit, cursor=cursor
)
@router.get("/customer-service/handover-tickets/{ticket_no}")
async def get_customer_service_handover_ticket(
ticket_no: str,
context: RequestContext = Depends(build_request_context), # noqa: B008
) -> dict[str, Any]:
"""只读查看单个工单的脱敏转接摘要。"""
return await CustomerServiceHandoverAdminService().get_ticket(ticket_no, context)