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

add support

parent 754252be
No related branches found
No related tags found
No related merge requests found
......@@ -18,10 +18,12 @@
package impl
import (
hessian "github.com/apache/dubbo-go-hessian2"
"reflect"
"strings"
)
import (
hessian "github.com/apache/dubbo-go-hessian2"
)
import (
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
......@@ -59,6 +61,7 @@ func (ef *GenericFilter) Invoke(invoker protocol.Invoker, invocation protocol.In
newParams,
}
newInvocation := invocation2.NewRPCInvocation(invocation.MethodName(), newArguments, invocation.Attachments())
newInvocation.SetReply(invocation.Reply())
return invoker.Invoke(newInvocation)
}
return invoker.Invoke(invocation)
......@@ -71,15 +74,15 @@ func (ef *GenericFilter) OnResponse(result protocol.Result, invoker protocol.Inv
func GetGenericFilter() filter.Filter {
return &GenericFilter{}
}
func struct2MapAll(obj interface{}) map[string]interface{} {
func struct2MapAll(obj interface{}) interface{} {
result := make(map[string]interface{})
if obj == nil {
return result
return obj
}
t := reflect.TypeOf(obj)
v := reflect.ValueOf(obj)
if reflect.TypeOf(obj).Kind() == reflect.Struct {
if t.Kind() == reflect.Struct {
for i := 0; i < t.NumField(); i++ {
if v.Field(i).Kind() == reflect.Struct {
if v.Field(i).CanInterface() {
......@@ -95,8 +98,10 @@ func struct2MapAll(obj interface{}) map[string]interface{} {
}
}
}
return result
} else {
return obj
}
return result
}
func headerAtoa(a string) (b string) {
b = strings.ToLower(a[:1]) + a[1:]
......
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