mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-01 15:18:59 +08:00
conversation
This commit is contained in:
parent
73a73b7bc7
commit
92fc43cb3d
@ -99,6 +99,6 @@ func UpdateColumnsConversations(ownerUserIDList []string, conversationID string,
|
|||||||
|
|
||||||
func GetConversationIDListByUserID(userID string) ([]string, error) {
|
func GetConversationIDListByUserID(userID string) ([]string, error) {
|
||||||
var IDList []string
|
var IDList []string
|
||||||
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("user_id=?", userID).Pluck("conversation_id", &IDList).Error
|
err := db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Where("owner_user_id=?", userID).Pluck("conversation_id", &IDList).Error
|
||||||
return IDList, err
|
return IDList, err
|
||||||
}
|
}
|
||||||
|
@ -440,6 +440,7 @@ func GetUserConversationIDListFromCache(userID string) ([]string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", utils.Wrap(err, "getConversationIDList failed")
|
return "", utils.Wrap(err, "getConversationIDList failed")
|
||||||
}
|
}
|
||||||
|
log.NewDebug("", utils.GetSelfFuncName(), conversationIDList)
|
||||||
bytes, err := json.Marshal(conversationIDList)
|
bytes, err := json.Marshal(conversationIDList)
|
||||||
return string(bytes), utils.Wrap(err, "")
|
return string(bytes), utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
@ -447,7 +448,7 @@ func GetUserConversationIDListFromCache(userID string) ([]string, error) {
|
|||||||
var conversationIDList []string
|
var conversationIDList []string
|
||||||
err = json.Unmarshal([]byte(conversationIDListStr), &conversationIDList)
|
err = json.Unmarshal([]byte(conversationIDListStr), &conversationIDList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
return conversationIDList, nil
|
return conversationIDList, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user