mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-09 20:49:34 +08:00
workmoment
This commit is contained in:
parent
79999edcea
commit
b18813689d
@ -647,7 +647,13 @@ func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUs
|
||||
if req.UserID == req.OpUserID {
|
||||
workMoments, err = db.DB.GetUserSelfWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||
} else {
|
||||
workMoments, err = db.DB.GetUserWorkMoments(req.OpUserID, req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||
friendIDList, err := rocksCache.GetFriendIDListFromCache(req.UserID)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments", err.Error())
|
||||
resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}
|
||||
return resp, nil
|
||||
}
|
||||
workMoments, err = db.DB.GetUserWorkMoments(req.OpUserID, req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber, friendIDList)
|
||||
}
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments failed", err.Error())
|
||||
|
@ -511,11 +511,11 @@ type config struct {
|
||||
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
|
||||
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
|
||||
OaNotification bool `yaml:"oaNotification"`
|
||||
CreateOrganizationUserAndJoinDepartment bool `json:"createOrganizationUserAndJoinDepartment"`
|
||||
CreateOrganizationUserAndJoinDepartment bool `yaml:"createOrganizationUserAndJoinDepartment"`
|
||||
}
|
||||
WorkMoment struct {
|
||||
OnlyFriendCanSee bool `yaml:"onlyFriendCanSee"`
|
||||
}
|
||||
} `yaml:"workMoment"`
|
||||
Rtc struct {
|
||||
SignalTimeout string `yaml:"signalTimeout"`
|
||||
} `yaml:"rtc"`
|
||||
|
@ -970,7 +970,7 @@ func (d *DataBases) GetUserSelfWorkMoments(userID string, showNumber, pageNumber
|
||||
return workMomentList, err
|
||||
}
|
||||
|
||||
func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, pageNumber int32) ([]WorkMoment, error) {
|
||||
func (d *DataBases) GetUserWorkMoments(opUserID, userID string, showNumber, pageNumber int32, friendIDList []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
|
||||
|
Loading…
x
Reference in New Issue
Block a user