conversationLocalCache

This commit is contained in:
wangchuxiao
2023-05-17 17:09:26 +08:00
parent 9b633b6729
commit dacf6cca31
8 changed files with 651 additions and 421 deletions
+10 -4
View File
@@ -195,9 +195,6 @@ func (c *conversationServer) SetConversations(ctx context.Context, req *pbConver
if req.Conversation.DraftTextTime != nil {
m["draft_text_time"] = req.Conversation.DraftTextTime.Value
}
if req.Conversation.UnreadCount != nil {
m["unread_count"] = req.Conversation.UnreadCount.Value
}
if req.Conversation.AttachedInfo != nil {
m["attached_info"] = req.Conversation.AttachedInfo.Value
}
@@ -283,7 +280,8 @@ func (c *conversationServer) CreateGroupChatConversations(ctx context.Context, r
func (c *conversationServer) DelGroupChatConversations(ctx context.Context, req *pbConversation.DelGroupChatConversationsReq) (*pbConversation.DelGroupChatConversationsResp, error) {
if err := c.conversationDatabase.UpdateUsersConversationFiled(ctx, req.OwnerUserID,
utils.GetConversationIDBySessionType(constant.SuperGroupChatType, req.GroupID), map[string]interface{}{"max_seq": req.MaxSeq}); err != nil {
utils.GetConversationIDBySessionType(constant.SuperGroupChatType, req.GroupID),
map[string]interface{}{"max_seq": req.MaxSeq}); err != nil {
return nil, err
}
return &pbConversation.DelGroupChatConversationsResp{}, nil
@@ -315,3 +313,11 @@ func (c *conversationServer) GetConversationsHasReadAndMaxSeq(ctx context.Contex
}
return resp, nil
}
func (c *conversationServer) GetUserConversationIDsHash(ctx context.Context, req *pbConversation.GetUserConversationIDsHashReq) (*pbConversation.GetUserConversationIDsHashResp, error) {
hash, err := c.conversationDatabase.GetUserConversationIDsHash(ctx, req.OwnerUserID)
if err != nil {
return nil, err
}
return &pbConversation.GetUserConversationIDsHashResp{Hash: hash}, nil
}