work_moments

pull/455/head
wangchuxiao 3 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 67dcd24410
commit 8d93d5a780

@ -180,7 +180,7 @@ func GetUserWorkMoments(c *gin.Context) {
return return
} }
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) ok, opUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok { if !ok {
log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token"))
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
@ -191,7 +191,8 @@ func GetUserWorkMoments(c *gin.Context) {
PageNumber: req.PageNumber, PageNumber: req.PageNumber,
ShowNumber: req.ShowNumber, ShowNumber: req.ShowNumber,
} }
reqPb.UserID = userID reqPb.OpUserID = opUserID
reqPb.UserID = req.UserID
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName)
client := pbOffice.NewOfficeServiceClient(etcdConn) client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb)

@ -43,6 +43,7 @@ type WorkMomentsUserCommonReq struct {
type GetUserWorkMomentsReq struct { type GetUserWorkMomentsReq struct {
WorkMomentsUserCommonReq WorkMomentsUserCommonReq
UserID string `json:"userID"`
} }
type GetUserWorkMomentsResp struct { type GetUserWorkMomentsResp struct {

Loading…
Cancel
Save