Files
wecom_it_smart_desk/docs/class-diagram.mermaid
Simon 3a44141eac chore(config): 同步 src/ 路径迁移 + nginx SPA 路由 + 文档图简化
**src/ 路径迁移配套**:
- docker-compose.yml: backend context ./backend → ./src/backend
- docker-compose.yml: bind mount ./app → ./src/backend/app
- docker-compose.dev.yml: 3 个 bind mount 同步调整
- Dify 双路径超时从 12s 提到 20s(2026-07-20 用户反馈高峰期超时)

**nginx SPA 路由修复**(前端路由 /itagent/x → /itagent/index.html):
- nginx/nginx.conf: 加 try_files $uri /itagent/index.html

**生产环境 nginx 反代重写**:
- deploy-server/nginx.conf: 从 33 行 localhost 模板改为 357 行完整反代
  - 新增 /itdesk /itagent /itadmin /itportal /itterminal/itportal/meetingroom
    路由规则
  - 反代到 backend:8000 (API + WS)
  - / 根路径反代到数据查询平台

**架构图简化**(精简但保留关键类/时序):
- docs/class-diagram.mermaid: 215 行 → 59 行
- docs/sequence-diagram.mermaid: 115 行 → 35 行

合计 6 文件 + 470 行 / - 293 行
2026-08-03 18:46:10 +08:00

75 lines
2.3 KiB
Plaintext

classDiagram
class OptionSelectPayload {
+string conversation_id
+string option_label
+string option_value
+string selected_from_message_id
+UUID client_msg_id
+string question_id
+string option_id
+validate() bool
}
class Message {
+string id
+string conversation_id
+string sender_type
+string sender_id
+string content
+string msg_type
+dict extra_data
+datetime created_at
+__init__(...)
}
class OptionSelectHandler {
+__init__(session_factory, ws_manager)
+handle(payload, employee_id) Message
-acquire_advisory_lock(db, key) void
-find_duplicate(db, payload) Message
-persist(db, payload, employee_id) Message
-to_message_dict(message, masked) dict
}
class SensitiveMask {
+mask_sensitive_text(text) string
+mask_sensitive_value(value) string
}
class DifyFeedbackContext {
+string feedback_type
+string question_id
+string option_id
+string option_value
+string option_label
+to_inputs() dict
}
class SelectedOptionsSnapshotBuilder {
+__init__(db)
+build(conversation_id) list
}
class ConnectionManager {
+dict active_connections
+dict employee_connections
+__init__()
+broadcast(data) void
+broadcast_to_employees(ids, data) void
}
class ConversationStore {
+Message[] messages
+sendOptionSelect(selection) void
+handleNewMessage(data) void
+latestSelection(question_id) Message
}
class MessageBubble {
+Message message
+isLatestSelection() bool
+maskedContent() string
}
OptionSelectHandler --> OptionSelectPayload : validates
OptionSelectHandler --> Message : creates/returns
OptionSelectHandler --> SensitiveMask : masks outbound data
OptionSelectHandler --> ConnectionManager : broadcasts
OptionSelectHandler --> DifyFeedbackContext : creates after commit
SelectedOptionsSnapshotBuilder --> Message : queries latest per question
ConversationStore o-- Message : stores
MessageBubble --> ConversationStore : derives latest
MessageBubble --> Message : renders