feat:聊天页面相关功能优化,提供用户体验感

This commit is contained in:
bujinyuan
2026-04-20 15:40:16 +08:00
parent 0c1540bdee
commit ccfceefdaf
28 changed files with 1402 additions and 62 deletions

View File

@@ -96,9 +96,17 @@ type HistoryMessageRequest struct {
}
// HistoryMessageResponse 历史消息响应
//
// 已读状态回填设计2026-04-20
// - PeerLastReadMsgID单聊时填"对方 last_read_msg_id",用于前端在页面刷新后恢复 readStatusMap
// 避免已读标签变未读的体验退化;群聊时为 0
// - ReadCountMap群聊时批量返回"自己发送消息的 read_count",前端合并到 groupReadCountMap
// 单聊时为 nilJSON omitempty 省略,节省带宽)
type HistoryMessageResponse struct {
List []MessageDTO `json:"list"` // 消息列表ID 降序)
HasMore bool `json:"has_more"` // 是否还有更多历史消息
List []MessageDTO `json:"list"` // 消息列表ID 降序)
HasMore bool `json:"has_more"` // 是否还有更多历史消息
PeerLastReadMsgID int64 `json:"peer_last_read_msg_id"` // 单聊:对方已读位置(群聊=0
ReadCountMap map[int64]int `json:"read_count_map,omitempty"` // 群聊:{messageID: readCount}(仅自己发的消息)
}
// ====== 已读标记 DTO ======