mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-10 04:59:01 +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 {
|
if req.UserID == req.OpUserID {
|
||||||
workMoments, err = db.DB.GetUserSelfWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
workMoments, err = db.DB.GetUserSelfWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber)
|
||||||
} else {
|
} 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 {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments failed", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments failed", err.Error())
|
||||||
|
@ -511,11 +511,11 @@ type config struct {
|
|||||||
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
|
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
|
||||||
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
|
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
|
||||||
OaNotification bool `yaml:"oaNotification"`
|
OaNotification bool `yaml:"oaNotification"`
|
||||||
CreateOrganizationUserAndJoinDepartment bool `json:"createOrganizationUserAndJoinDepartment"`
|
CreateOrganizationUserAndJoinDepartment bool `yaml:"createOrganizationUserAndJoinDepartment"`
|
||||||
}
|
}
|
||||||
WorkMoment struct {
|
WorkMoment struct {
|
||||||
OnlyFriendCanSee bool `yaml:"onlyFriendCanSee"`
|
OnlyFriendCanSee bool `yaml:"onlyFriendCanSee"`
|
||||||
}
|
} `yaml:"workMoment"`
|
||||||
Rtc struct {
|
Rtc struct {
|
||||||
SignalTimeout string `yaml:"signalTimeout"`
|
SignalTimeout string `yaml:"signalTimeout"`
|
||||||
} `yaml:"rtc"`
|
} `yaml:"rtc"`
|
||||||
|
@ -970,7 +970,7 @@ func (d *DataBases) GetUserSelfWorkMoments(userID string, showNumber, pageNumber
|
|||||||
return workMomentList, err
|
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)
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment)
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cWorkMoment)
|
||||||
var workMomentList []WorkMoment
|
var workMomentList []WorkMoment
|
||||||
|
Loading…
x
Reference in New Issue
Block a user