ing
This commit is contained in:
parent
9c0a3b06a5
commit
82733cc45d
|
@ -2,11 +2,12 @@ package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
"git.loafle.net/commons_go/rpc"
|
"git.loafle.net/commons_go/rpc"
|
||||||
"git.loafle.net/commons_go/rpc/gateway"
|
"git.loafle.net/commons_go/rpc/gateway"
|
||||||
"git.loafle.net/commons_go/rpc/protocol"
|
"git.loafle.net/commons_go/rpc/protocol"
|
||||||
"git.loafle.net/commons_go/rpc/protocol/json"
|
crpj "git.loafle.net/commons_go/rpc/protocol/json"
|
||||||
oogw "git.loafle.net/overflow/overflow_gateway_websocket"
|
oogw "git.loafle.net/overflow/overflow_gateway_websocket"
|
||||||
"git.loafle.net/overflow/overflow_gateway_websocket/external/grpc"
|
"git.loafle.net/overflow/overflow_gateway_websocket/external/grpc"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
|
@ -14,7 +15,7 @@ import (
|
||||||
|
|
||||||
func newGatewayRPCServletHandler() GatewayRPCServletHandler {
|
func newGatewayRPCServletHandler() GatewayRPCServletHandler {
|
||||||
sh := &GatewayRPCServletHandlers{}
|
sh := &GatewayRPCServletHandlers{}
|
||||||
sh.RegisterCodec(json.Name, json.NewServerCodec())
|
sh.RegisterCodec(crpj.Name, crpj.NewServerCodec())
|
||||||
return sh
|
return sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +37,13 @@ func (sh *GatewayRPCServletHandlers) Invoke(servletCTX rpc.ServletContext, reque
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return r, nil
|
var m interface{}
|
||||||
|
err = json.Unmarshal([]byte(r), &m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sh *GatewayRPCServletHandlers) Validate() {
|
func (sh *GatewayRPCServletHandlers) Validate() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user