44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
|
|
sequenceDiagram
|
||
|
|
participant Emp as 员工(H5页面)
|
||
|
|
participant API as FastAPI
|
||
|
|
participant ConvSvc as ConversationService
|
||
|
|
participant Score as ScoringService
|
||
|
|
participant WXSvc as WecomService
|
||
|
|
participant Agent as 坐席工作台
|
||
|
|
participant DB as PostgreSQL
|
||
|
|
|
||
|
|
Emp->>API: POST /api/h5/conversation/shake
|
||
|
|
API->>ConvSvc: find_or_create_conversation(employee_id)
|
||
|
|
ConvSvc->>DB: 查询/创建 conversation
|
||
|
|
DB-->>ConvSvc: conversation
|
||
|
|
API->>Score: detect_hand_raise("摇人")
|
||
|
|
Score-->>API: hand_raise=True
|
||
|
|
API->>ConvSvc: update_conversation(tags={hand_raise:true})
|
||
|
|
ConvSvc->>DB: UPDATE conversations SET tags=...
|
||
|
|
API->>ConvSvc: get_funny_phrase(scene='shake')
|
||
|
|
ConvSvc->>DB: SELECT FROM funny_phrases WHERE scene='shake'
|
||
|
|
DB-->>ConvSvc: "大哥,俺这就去摇人,稍等..."
|
||
|
|
ConvSvc->>ConvSvc: send_message(conv_id, 'system', 趣味话术)
|
||
|
|
ConvSvc->>WXSvc: send_text_message(employee_id, 趣味话术)
|
||
|
|
API-->>Emp: {conversation, funny_phrase}
|
||
|
|
|
||
|
|
Note over Emp: H5显示摇人动画 + 趣味话术
|
||
|
|
|
||
|
|
loop 坐席轮询
|
||
|
|
Agent->>API: GET /api/conversations
|
||
|
|
API->>ConvSvc: get_conversations()
|
||
|
|
ConvSvc->>DB: SELECT ... ORDER BY urgency DESC
|
||
|
|
DB-->>ConvSvc: 列表(举手会话靠前)
|
||
|
|
API-->>Agent: 举手标记的会话(黄色标签)
|
||
|
|
end
|
||
|
|
|
||
|
|
Agent->>API: POST /api/conversations/{id}/assign {agent_id}
|
||
|
|
API->>ConvSvc: update_conversation(status='serving', assigned_agent_id)
|
||
|
|
ConvSvc->>DB: UPDATE conversations SET status='serving'
|
||
|
|
ConvSvc->>ConvSvc: send_message(conv_id, 'system', '人摇来了!IT坐席为您服务')
|
||
|
|
ConvSvc->>WXSvc: send_text_message(employee_id, 接入话术)
|
||
|
|
ConvSvc-->>API: updated conversation
|
||
|
|
API-->>Agent: 接单成功
|
||
|
|
|
||
|
|
WXSvc-->>Emp: 企微推送"人摇来了!IT坐席为您服务"
|