Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release

pull/258/head
Gordon 2 years ago
commit 9d6d28dcae

@ -150,7 +150,7 @@ func ParseToken(c *gin.Context) {
if err := c.BindJSON(&params); err != nil { if err := c.BindJSON(&params); err != nil {
errMsg := " BindJSON failed " + err.Error() errMsg := " BindJSON failed " + err.Error()
log.NewError("0", errMsg) log.NewError("0", errMsg)
c.JSON(http.StatusBadRequest, gin.H{"errCode": 200, "errMsg": errMsg}) c.JSON(http.StatusOK, gin.H{"errCode": 1001, "errMsg": errMsg})
return return
} }
@ -161,7 +161,7 @@ func ParseToken(c *gin.Context) {
if !ok { if !ok {
errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token") errMsg := params.OperationID + " " + "GetUserIDFromTokenExpireTime failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(params.OperationID, errMsg) log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 200, "errMsg": errMsg}) c.JSON(http.StatusOK, gin.H{"errCode": 1001, "errMsg": errMsg})
return return
} }

@ -9,6 +9,7 @@ import (
commonPb "Open_IM/pkg/proto/sdk_ws" commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"github.com/go-redis/redis/v8"
) )
func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) {
@ -17,6 +18,10 @@ func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.
//userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) //userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID)
groupIDList, err := rocksCache.GetJoinedSuperGroupListFromCache(req.UserID) groupIDList, err := rocksCache.GetJoinedSuperGroupListFromCache(req.UserID)
if err != nil { if err != nil {
if err == redis.Nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID nil ", err.Error(), req.UserID)
return resp, nil
}
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID) log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed ", err.Error(), req.UserID)
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg

Loading…
Cancel
Save