mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-11 20:45:57 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
# Conflicts: # internal/api_to_rpc/api.go
This commit is contained in:
@@ -1262,7 +1262,8 @@ func GetGroupAbstractInfo(c *gin.Context) {
|
||||
GroupMemberNumber int32 `json:"groupMemberNumber"`
|
||||
GroupMemberListHash uint64 `json:"groupMemberListHash"`
|
||||
}
|
||||
common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
//common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), nil)
|
||||
|
||||
//var (
|
||||
//req api.GetGroupAbstractInfoReq
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"Open_IM/pkg/common/trace_log"
|
||||
"Open_IM/pkg/getcdv3"
|
||||
utils2 "Open_IM/pkg/utils"
|
||||
"context"
|
||||
"fmt"
|
||||
utils "github.com/OpenIMSDK/open_utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
@@ -45,10 +45,11 @@ func ApiToRpc(c *gin.Context, apiReq, apiResp interface{}, rpcName string, rpcCl
|
||||
return
|
||||
}
|
||||
trace_log.SetCtxInfo(nCtx, logFuncName, nil, "opUserID", opUserID, "callRpcReq", rpcString(rpcReqPtr.Elem().Interface()))
|
||||
md := metadata.Pairs("operationID", operationID, "opUserID", opUserID)
|
||||
//md := metadata.Pairs("operationID", operationID, "opUserID", opUserID)
|
||||
respArr := rpc.Call([]reflect.Value{
|
||||
reflect.ValueOf(metadata.NewOutgoingContext(c, md)), // context.Context
|
||||
rpcReqPtr, // rpc apiReq
|
||||
//reflect.ValueOf(metadata.NewOutgoingContext(c, md)), // context.Context
|
||||
reflect.ValueOf(context.Context(c)), // context.Context
|
||||
rpcReqPtr, // rpc apiReq
|
||||
}) // respArr => (apiResp, error)
|
||||
if !respArr[1].IsNil() { // rpc err != nil
|
||||
err := respArr[1].Interface().(error)
|
||||
|
||||
Reference in New Issue
Block a user