From a711272d7f6f26a9344d536ed42bf3f0832dc4c5 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 29 Nov 2017 20:24:47 +0900 Subject: [PATCH] ing --- .../rpc/gateway_rpc_servlet_handlers.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/server/rpc/gateway_rpc_servlet_handlers.go b/internal/server/rpc/gateway_rpc_servlet_handlers.go index 41e5c3a..19aa6fc 100644 --- a/internal/server/rpc/gateway_rpc_servlet_handlers.go +++ b/internal/server/rpc/gateway_rpc_servlet_handlers.go @@ -1,13 +1,15 @@ package rpc import ( - "fmt" + "context" - "git.loafle.net/commons_go/logging" "git.loafle.net/commons_go/rpc" "git.loafle.net/commons_go/rpc/gateway" "git.loafle.net/commons_go/rpc/protocol" "git.loafle.net/commons_go/rpc/protocol/json" + "git.loafle.net/overflow/overflow_gateway_web/grpc" + oogw "git.loafle.net/overflow/overflow_gateway_websocket" + "google.golang.org/grpc/metadata" ) func newGatewayRPCServletHandler() GatewayRPCServletHandler { @@ -21,20 +23,18 @@ type GatewayRPCServletHandlers struct { } func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, requestCodec protocol.RegistryCodec) (result interface{}, err error) { - // md := metadata.Pairs(oogw.GRPCUserIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string)) - // grpcCTX := metadata.NewOutgoingContext(context.Background(), md) + md := metadata.Pairs(oogw.GRPCUserIDKey, servletCTX.GetAttribute(oogw.SocketIDKey).(string)) + grpcCTX := metadata.NewOutgoingContext(context.Background(), md) params, err := requestCodec.Params() if nil != err { return nil, err } - logging.Logger().Debug(fmt.Sprintf("method:%s, params:%v", requestCodec.Method(), params)) - // r, err := grpc.Exec(grpcCTX, requestCodec.Method(), params) - // if err != nil { - // return nil, err - // } - r := "dfksdkdskf" + r, err := grpc.Exec(grpcCTX, requestCodec.Method(), params) + if err != nil { + return nil, err + } return r, nil }