feat(im): Task 4 - WS 事件处理器 + 离线消息推送
EventHandler: - im.message.send: 发送消息(解析→业务→ACK+推送) - im.message.recall: 撤回消息 - im.conversation.read: 标记已读 - im.typing: 正在输入通知(转发对方) - 所有事件通过 Hub.RegisterEvent 注册到路由表 OfflinePusher: - PushOfflineMessages: 推送未读会话摘要 + 全局未读总数 - 通过 OfflineMessagePusher 接口注入 WS Handler - WebSocket 连接建立后自动触发离线推送 Made-with: Cursor
This commit is contained in:
@@ -454,6 +454,11 @@ func (s *IMService) GetTotalUnread(ctx context.Context, userID int64) (int64, er
|
||||
return val, err
|
||||
}
|
||||
|
||||
// GetPeerUserID 获取单聊会话中对方的用户 ID(供 handler 层调用)
|
||||
func (s *IMService) GetPeerUserID(ctx context.Context, conversationID, userID int64) (int64, error) {
|
||||
return s.convDAO.GetPeerUserID(ctx, conversationID, userID)
|
||||
}
|
||||
|
||||
// ====== 内部辅助方法 ======
|
||||
|
||||
// getOrCreatePrivateConversation 查找或创建单聊会话
|
||||
|
||||
Reference in New Issue
Block a user