Skip to content
Snippets Groups Projects
Commit 754252be authored by pantianying's avatar pantianying
Browse files

add hessain.Object to genericfilter

parent c3d2c9ca
No related branches found
No related tags found
No related merge requests found
...@@ -44,13 +44,19 @@ type GenericFilter struct{} ...@@ -44,13 +44,19 @@ type GenericFilter struct{}
func (ef *GenericFilter) Invoke(invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { func (ef *GenericFilter) Invoke(invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
if invocation.MethodName() == constant.GENERIC && len(invocation.Arguments()) == 3 { if invocation.MethodName() == constant.GENERIC && len(invocation.Arguments()) == 3 {
var ( oldArguments := invocation.Arguments()
oldArguments = invocation.Arguments() var newParams []hessian.Object
) if oldParams, ok := oldArguments[2].([]interface{}); ok {
for i := range oldParams {
newParams = append(newParams, hessian.Object(struct2MapAll(oldParams[i])))
}
} else {
return invoker.Invoke(invocation)
}
newArguments := []interface{}{ newArguments := []interface{}{
oldArguments[0], oldArguments[0],
oldArguments[1], oldArguments[1],
hessian.Object(struct2MapAll(oldArguments[2])), newParams,
} }
newInvocation := invocation2.NewRPCInvocation(invocation.MethodName(), newArguments, invocation.Attachments()) newInvocation := invocation2.NewRPCInvocation(invocation.MethodName(), newArguments, invocation.Attachments())
return invoker.Invoke(newInvocation) return invoker.Invoke(newInvocation)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment