mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
6b98c3fed5
@ -6,6 +6,7 @@ import (
|
||||
pbCommon "Open_IM/pkg/proto/sdk_ws"
|
||||
"encoding/json"
|
||||
"github.com/garyburd/redigo/redis"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -192,12 +193,8 @@ func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...interface
|
||||
}
|
||||
|
||||
func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) {
|
||||
result, err := redis.Values(d.Exec("SMEMBERS", friendRelationCache+userID))
|
||||
var userIDList []string
|
||||
for _, v := range result {
|
||||
userIDList = append(userIDList, v.(string))
|
||||
}
|
||||
return userIDList, err
|
||||
result, err := redis.String(d.Exec("SMEMBERS", friendRelationCache+userID))
|
||||
return strings.Split(result, " "), err
|
||||
}
|
||||
|
||||
func (d *DataBases) AddBlackUserToCache(userID string, blackList ...interface{}) error {
|
||||
@ -211,10 +208,6 @@ func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...interfa
|
||||
}
|
||||
|
||||
func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) {
|
||||
result, err := redis.Values(d.Exec("SMEMBERS", blackListCache+userID))
|
||||
var userIDList []string
|
||||
for _, v := range result {
|
||||
userIDList = append(userIDList, v.(string))
|
||||
}
|
||||
return userIDList, err
|
||||
result, err := redis.String(d.Exec("SMEMBERS", blackListCache+userID))
|
||||
return strings.Split(result, " "), err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user