mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-17 09:44:47 +08:00
1
This commit is contained in:
parent
16864dab7d
commit
d06dc3e4b5
@ -4,6 +4,7 @@ import (
|
|||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/common/trace_log"
|
"Open_IM/pkg/common/trace_log"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -66,19 +67,18 @@ func rpcString(v interface{}) string {
|
|||||||
return fmt.Sprintf("%+v", v)
|
return fmt.Sprintf("%+v", v)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func RpcClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
|
func RpcClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error) {
|
||||||
// //if cc == nil {
|
//if cc == nil {
|
||||||
// // return utils.Wrap(constant.ErrRpcConn, "")
|
// return utils.Wrap(constant.ErrRpcConn, "")
|
||||||
// //}
|
//}
|
||||||
// operationID, ok := ctx.Value("operationID").(string)
|
operationID, ok := ctx.Value("operationID").(string)
|
||||||
// if !ok {
|
if !ok {
|
||||||
// return utils.Wrap(constant.ErrArgs, "ctx missing operationID")
|
return utils.Wrap(constant.ErrArgs, "ctx missing operationID")
|
||||||
// }
|
}
|
||||||
// opUserID, ok := ctx.Value("opUserID").(string)
|
opUserID, ok := ctx.Value("opUserID").(string)
|
||||||
// if !ok {
|
if !ok {
|
||||||
// return utils.Wrap(constant.ErrArgs, "ctx missing opUserID")
|
return utils.Wrap(constant.ErrArgs, "ctx missing opUserID")
|
||||||
// }
|
}
|
||||||
// md := metadata.Pairs("operationID", operationID, "opUserID", opUserID)
|
md := metadata.Pairs("operationID", operationID, "opUserID", opUserID)
|
||||||
// return invoker(metadata.NewOutgoingContext(ctx, md), method, req, reply, cc, opts...)
|
return invoker(metadata.NewOutgoingContext(ctx, md), method, req, reply, cc, opts...)
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user