mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-03 16:45:59 +08:00
cache
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
pbCommon "Open_IM/pkg/proto/sdk_ws"
|
||||
"encoding/json"
|
||||
"github.com/garyburd/redigo/redis"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -193,8 +192,8 @@ func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...interface
|
||||
}
|
||||
|
||||
func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) {
|
||||
result, err := redis.String(d.Exec("SMEMBERS", friendRelationCache+userID))
|
||||
return strings.Split(result, " "), err
|
||||
result, err := redis.Strings(d.Exec("SMEMBERS", friendRelationCache+userID))
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (d *DataBases) AddBlackUserToCache(userID string, blackList ...interface{}) error {
|
||||
@@ -208,6 +207,6 @@ func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...interfa
|
||||
}
|
||||
|
||||
func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) {
|
||||
result, err := redis.String(d.Exec("SMEMBERS", blackListCache+userID))
|
||||
return strings.Split(result, " "), err
|
||||
result, err := redis.Strings(d.Exec("SMEMBERS", blackListCache+userID))
|
||||
return result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user