23 lines
601 B
Plaintext
23 lines
601 B
Plaintext
@startuml
|
|
actor 用户
|
|
participant 客户端
|
|
participant WebSocket
|
|
participant 服务器
|
|
|
|
== 发送消息 ==
|
|
|
|
用户 -> 客户端 : 输入消息
|
|
客户端 -> 客户端 : 本地存储为 sending 状态
|
|
客户端 -> WebSocket : 发送消息 JSON
|
|
WebSocket -> 服务器 : 转发消息
|
|
服务器 -> WebSocket : ACK + 推送给对方
|
|
WebSocket -> 客户端 : 返回ACK
|
|
客户端 -> 客户端 : 更新消息状态为 sent
|
|
|
|
== 同步消息 ==
|
|
|
|
客户端 -> 服务器 : 请求 /sync?last_msg_id=xxx
|
|
服务器 -> 客户端 : 返回缺失的消息列表
|
|
客户端 -> 客户端 : 写入本地 + UI展示
|
|
@enduml
|