mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
cache rpc
This commit is contained in:
parent
9f9ebd838a
commit
08f968dced
@ -515,7 +515,7 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice
|
||||
return resp, nil
|
||||
}
|
||||
for _, friendID := range friendIDList {
|
||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), *friendID)
|
||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), friendID)
|
||||
}
|
||||
workMoments, err := db.DB.GetUserFriendWorkMoments(friendIDList, req.Pagination.ShowNumber, req.Pagination.PageNumber, req.UserID)
|
||||
if err != nil {
|
||||
|
@ -692,7 +692,7 @@ func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, page
|
||||
return workMomentList, err
|
||||
}
|
||||
|
||||
func (d *DataBases) GetUserFriendWorkMoments(friendIDList []*string, showNumber, pageNumber int32, userID string) ([]WorkMoment, error) {
|
||||
func (d *DataBases) GetUserFriendWorkMoments(friendIDList []string, showNumber, pageNumber int32, userID string) ([]WorkMoment, error) {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment)
|
||||
var workMomentList []WorkMoment
|
||||
|
@ -49,12 +49,12 @@ func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error) {
|
||||
return friends, nil
|
||||
}
|
||||
|
||||
func GetFriendIDListByUserID(OwnerUserID string) ([]*string, error) {
|
||||
func GetFriendIDListByUserID(OwnerUserID string) ([]string, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var friendIDList []*string
|
||||
var friendIDList []string
|
||||
err = dbConn.Table("friends").Select("friend_user_id").Where("owner_user_id=?", OwnerUserID).Find(&friendIDList).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user