diff --git a/README.md b/README.md index be20d6f3..ac255520 100644 --- a/README.md +++ b/README.md @@ -12,39 +12,61 @@ 基于已有的 **dubbo Interface API** 和 [**类型映射**](#类型映射),编写 **api.thrift**。然后使用最新的 kitex 命令行工具和 thriftgo 生成 kitex 的脚手架代码(包括用于编解码的stub代码)。 +除了默认的类型映射外,还可以在 **thrift** 中使用 [**方法注解**](#方法注解) 指定请求参数映射的 java 类型。 + 2. **dubbo -> kitex** 基于已有的 **api.thrift** 和 [**类型映射**](#类型映射),编写 dubbo 客户端代码。 ### 类型映射 -| thrift 类型 | golang 类型 | hessian2 类型 | java 类型 | -|:------------------:|:----------------:|:-----------:|:----------------------:| -| bool | bool | boolean | java.lang.Boolean | -| byte | int8 | int | java.lang.Byte | -| i16 | int16 | int | java.lang.Short | -| i32 | int32 | int | java.lang.Integer | -| i64 | int64 | long | java.lang.Long | -| double | float64 | double | java.lang.Double | -| string | string | string | java.lang.String | -| binary | []byte | binary | byte[] | -| list\ | []bool | list | List\ | -| list\ | []int32 | list | List\ | -| list\ | []int64 | list | List\ | -| list\ | []float64 | list | List\ | -| list\ | []string | list | List\ | -| map\ | map[bool]bool | map | Map\ | -| map\ | map[bool]int32 | map | Map\ | -| map\ | map[bool]int64 | map | Map\ | -| map\ | map[bool]float64 | map | Map\ | -| map\ | map[bool]string | map | Map\ | +| thrift 类型 | golang 类型 | hessian2 类型 | 默认 java 类型 | 可拓展 java 类型 | +|:------------------:|:----------------:|:-----------:|:----------------------:|:-------------------------------:| +| bool | bool | boolean | java.lang.Boolean | boolean | +| byte | int8 | int | java.lang.Byte | byte | +| i16 | int16 | int | java.lang.Short | short | +| i32 | int32 | int | java.lang.Integer | int | +| i64 | int64 | long | java.lang.Long | long | +| double | float64 | double | java.lang.Double | double | +| string | string | string | java.lang.String | - | +| binary | []byte | binary | byte[] | - | +| list\ | []bool | list | List\ | boolean[] / ArrayList\ | +| list\ | []int32 | list | List\ | int[] / ArrayList\ | +| list\ | []int64 | list | List\ | long[] / ArrayList\ | +| list\ | []float64 | list | List\ | double[] / ArrayList\ | +| list\ | []string | list | List\ | String[] / ArrayList\ | +| map\ | map[bool]bool | map | Map\ | HashMap\ | +| map\ | map[bool]int32 | map | Map\ | HashMap\ | +| map\ | map[bool]int64 | map | Map\ | HashMap\ | +| map\ | map[bool]float64 | map | Map\ | HashMap\ | +| map\ | map[bool]string | map | Map\ | HashMap\ | **重要提示**: 1. 映射表中的 map 类型并没有被完全列举,当前仅包含经过测试的用例。 请勿在map类型中使用包含 **i8**、**i16** 和 **binary** 的键值。 -2. 当前仅支持表格中所记录的 thrift 类型和 java 类型映射。 - 更多映射关系(例如,**bool** <-> **boolean**)将在未来支持,请参考 [issue](https://github.com/kitex-contrib/codec-dubbo/issues/46)。 -3. 目前不支持float32,因为它在 thrift 中不是有效的类型。计划在后续迭代中支持该类型。 +2. 目前不支持float32,因为它在 thrift 中不是有效的类型。计划在后续迭代中支持该类型。 + +### 方法注解 + +DubboCodec 支持在 **thrift** 中使用 **方法注解** 指定请求参数需要映射的 java 类型。 + +**方法注解格式:** +```thrift +(hessian.argsType="req1JavaType,req2JavaType,req3JavaType,...") +``` +其中,每个 reqJavaType 可以使用 `-` 或不填写,表示该参数将使用默认的类型映射。 + +添加方法注解后,使用 kitex 命令行工具生成代码时添加选项 `-thrift with_reflection`,会在生成的脚手架代码中包含 thrift 的 **FileDescriptor**。 +在初始化 client 时使用 DubboCodec 提供的 `WithFileDescriptor` Option,传入生成的 **FileDescriptor**,即可指定 **kitex -> dubbo** 的类型映射。 + +**举例:** +```thrift +service EchoService { + EchoResponse Echo(1: i32 req1, 2: list req2, 3: map req3) (hessian.argsType="int,int[],java.util.HashMap") + // 使用默认的类型映射 + EchoDefaultTypeResponse EchoDefaultType(1: i32 req1, 2: i64 req2, 3: bool req3, 4: string req4) (hessian.argsType=",-,,-") +} +``` ## 开始 diff --git a/README_ENG.md b/README_ENG.md index de4f25c7..d187b410 100644 --- a/README_ENG.md +++ b/README_ENG.md @@ -14,40 +14,61 @@ English | [中文](README.md) Write **api.thrift** based on existing **dubbo Interface API** and [**Type Mapping Table**](#type-mapping). Then use the latest kitex command tool and thriftgo to generate Kitex's scaffold (including stub code). +In addition to the default type mapping, you can also specify the Java type for request parameter mapping in **thrift** using [**Method Annotation**](#method-annotation). + 2. **dubbo -> kitex** Write dubbo client code based on existing **api.thrift** and [**Type Mapping Table**](#type-mapping). ### Type Mapping -| thrift type | golang type | hessian2 type | java type | -|:------------------:|:----------------:|:-------------:|:----------------------:| -| bool | bool | boolean | java.lang.Boolean | -| byte | int8 | int | java.lang.Byte | -| i16 | int16 | int | java.lang.Short | -| i32 | int32 | int | java.lang.Integer | -| i64 | int64 | long | java.lang.Long | -| double | float64 | double | java.lang.Double | -| string | string | string | java.lang.String | -| binary | []byte | binary | byte[] | -| list\ | []bool | list | List\ | -| list\ | []int32 | list | List\ | -| list\ | []int64 | list | List\ | -| list\ | []float64 | list | List\ | -| list\ | []string | list | List\ | -| map\ | map[bool]bool | map | Map\ | -| map\ | map[bool]int32 | map | Map\ | -| map\ | map[bool]int64 | map | Map\ | -| map\ | map[bool]float64 | map | Map\ | -| map\ | map[bool]string | map | Map\ | +| thrift type | golang type | hessian2 type | default java type | extendable java type | +|:------------------:|:----------------:|:-------------:|:----------------------:|:-------------------------------:| +| bool | bool | boolean | java.lang.Boolean | boolean | +| byte | int8 | int | java.lang.Byte | byte | +| i16 | int16 | int | java.lang.Short | short | +| i32 | int32 | int | java.lang.Integer | int | +| i64 | int64 | long | java.lang.Long | long | +| double | float64 | double | java.lang.Double | double | +| string | string | string | java.lang.String | - | +| binary | []byte | binary | byte[] | - | +| list\ | []bool | list | List\ | boolean[] / ArrayList\ | +| list\ | []int32 | list | List\ | int[] / ArrayList\ | +| list\ | []int64 | list | List\ | long[] / ArrayList\ | +| list\ | []float64 | list | List\ | double[] / ArrayList\ | +| list\ | []string | list | List\ | String[] / ArrayList\ | +| map\ | map[bool]bool | map | Map\ | HashMap\ | +| map\ | map[bool]int32 | map | Map\ | HashMap\ | +| map\ | map[bool]int64 | map | Map\ | HashMap\ | +| map\ | map[bool]float64 | map | Map\ | HashMap\ | +| map\ | map[bool]string | map | Map\ | HashMap\ | **Important notes**: 1. The list of map types is not exhaustive and includes only tested cases. Please do not use keys and values with **i8**, **i16** and **binary**. -2. Currently only the thrift type and java type mappings documented in the table are supported. - More mappings(e.g. **bool** <-> **boolean**) would be supported in the future. - Please see [issue](https://github.com/kitex-contrib/codec-dubbo/issues/46). -3. float32 is planned but currently not supported since it's not a valid type in thrift. +2. float32 is planned but currently not supported since it's not a valid type in thrift. + +### Method Annotation + +DubboCodec supports specifying the Java types needed for request parameter mapping in **thrift** using **method annotations**. + +**Method Annotation Format:** +```thrift +(hessian.argsType="req1JavaType,req2JavaType,req3JavaType,...") +``` +Here, each `reqJavaType` can either be left blank or use a `-`, indicating that the default type mapping will be used for that parameter. + +After adding method annotations, use the kitex command line tool to generate code and add the option `-thrift with_reflection`. This will include the **FileDescriptor** of thrift in the generated scaffold code. +When initializing the client, use DubboCodec's `WithFileDescriptor` Option, and pass in the generated **FileDescriptor** to specify the **kitex -> dubbo** type mapping. + +**Example:** +```thrift +service EchoService { + EchoResponse Echo(1: i32 req1, 2: list req2, 3: map req3) (hessian.argsType="int,int[],java.util.HashMap") + // Use the default type mapping + EchoDefaultTypeResponse EchoDefaultType(1: i32 req1, 2: i64 req2, 3: bool req3, 4: string req4) (hessian.argsType=",-,,-") +} +``` ## Getting Started diff --git a/go.mod b/go.mod index 338337b4..ddd2e96e 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( dubbo.apache.org/dubbo-go/v3 v3.1.0 github.com/apache/dubbo-go-hessian2 v1.12.2 github.com/cloudwego/kitex v0.6.2-0.20230815060351-88ea60530d40 + github.com/cloudwego/thriftgo v0.3.0 github.com/dubbogo/tools v1.0.9 github.com/stretchr/testify v1.8.2 golang.org/x/net v0.17.0 // indirect diff --git a/go.sum b/go.sum index 0b876962..6e1d6e11 100644 --- a/go.sum +++ b/go.sum @@ -1465,7 +1465,6 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= @@ -1599,7 +1598,6 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= @@ -1764,7 +1762,6 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= @@ -1793,7 +1790,6 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= diff --git a/pkg/codec.go b/pkg/codec.go index 0231e0bd..9bec774b 100644 --- a/pkg/codec.go +++ b/pkg/codec.go @@ -34,7 +34,8 @@ var _ remote.Codec = (*DubboCodec)(nil) // DubboCodec NewDubboCodec creates the dubbo codec. type DubboCodec struct { - opt *Options + opt *Options + methodCache hessian2.MethodCache } // NewDubboCodec creates a new codec instance. @@ -227,7 +228,9 @@ func (m *DubboCodec) messageData(message remote.Message, e iface.Encoder) error if !ok { return fmt.Errorf("invalid data: not hessian2.MessageWriter") } - types, err := hessian2.GetTypes(data) + + typeAnno := m.getTypeAnnotation(message) + types, err := m.methodCache.GetTypes(data, typeAnno) if err != nil { return err } @@ -264,6 +267,17 @@ func (m *DubboCodec) messageAttachment(ctx context.Context, service *dubbo_spec. return e.Encode(attachment) } +func (m *DubboCodec) getTypeAnnotation(message remote.Message) *hessian2.TypeAnnotation { + var typeAnno *hessian2.TypeAnnotation + methodKey := message.ServiceInfo().ServiceName + "." + message.RPCInfo().To().Method() + if m.opt.TypeAnnotations != nil { + if t, ok := m.opt.TypeAnnotations[methodKey]; ok { + typeAnno = t + } + } + return typeAnno +} + // Unmarshal decode method func (m *DubboCodec) Decode(ctx context.Context, message remote.Message, in remote.ByteBuffer) error { // parse header part diff --git a/pkg/hessian2/annotation.go b/pkg/hessian2/annotation.go new file mode 100644 index 00000000..bc4953f4 --- /dev/null +++ b/pkg/hessian2/annotation.go @@ -0,0 +1,43 @@ +/* + * Copyright 2023 CloudWeGo Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package hessian2 + +import "strings" + +// TypeAnnotation is used to store and parse a type annotation. +type TypeAnnotation struct { + anno string + fieldTypes []string +} + +// NewTypeAnnotation is used to create a type annotation object. +func NewTypeAnnotation(anno string) *TypeAnnotation { + ta := &TypeAnnotation{anno: anno} + ta.fieldTypes = strings.Split(ta.anno, ",") + return ta +} + +// GetFieldType retrieves the type annotation for a field by its index. +func (ta *TypeAnnotation) GetFieldType(i int) string { + if ta != nil && len(ta.fieldTypes) > i { + return ta.fieldTypes[i] + } + return "" +} diff --git a/pkg/hessian2/const.go b/pkg/hessian2/const.go index 640589cb..9823c8e9 100644 --- a/pkg/hessian2/const.go +++ b/pkg/hessian2/const.go @@ -23,4 +23,6 @@ import hessian "github.com/apache/dubbo-go-hessian2" const ( NULL = hessian.BC_NULL + + HESSIAN_ARGS_TYPE_TAG = "hessian.argsType" ) diff --git a/pkg/hessian2/parameter.go b/pkg/hessian2/parameter.go index 4c226b1a..cfa307e3 100644 --- a/pkg/hessian2/parameter.go +++ b/pkg/hessian2/parameter.go @@ -33,37 +33,48 @@ import ( hessian "github.com/apache/dubbo-go-hessian2" ) -var cache = new(typesCache) - -// typesCache maintains a cache from type of data(reflect.Type) to Types string used by Hessian2. -type typesCache struct { +// MethodCache maintains a cache from method parameter types (reflect.Type) and method annotations to the type strings used by Hessian2. +type MethodCache struct { group Group typesMap sync.Map } -// getByData returns the Types string of given data. +type methodKey struct { + typ reflect.Type + anno string +} + +// GetTypes returns the Types string for the given method parameter data and method annotations. // It reads embedded sync.Map firstly. If cache misses, using singleFlight to process reflection and getParamsTypeList. -func (tc *typesCache) getByData(data interface{}) (string, error) { +func (mc *MethodCache) GetTypes(data interface{}, ta *TypeAnnotation) (string, error) { val := reflect.ValueOf(data) - typ := val.Type() - typesRaw, ok := tc.typesMap.Load(typ) + key := methodKey{typ: val.Type()} + if ta != nil { + key.anno = ta.anno + } + typesRaw, ok := mc.typesMap.Load(key) if ok { return typesRaw.(string), nil } - typesRaw, err, _ := tc.group.Do(typ, func() (interface{}, error) { + typesRaw, err, _ := mc.group.Do(key, func() (interface{}, error) { elem := val.Elem() numField := elem.NumField() - fields := make([]interface{}, numField) + fields := make([]*parameter, numField) for i := 0; i < numField; i++ { - fields[i] = elem.Field(i).Interface() + fields[i] = ¶meter{ + value: elem.Field(i).Interface(), + } + if ta != nil { + fields[i].typeAnno = ta.GetFieldType(i) + } } types, err := getParamsTypeList(fields) if err != nil { return "", err } - tc.typesMap.Store(typ, types) + mc.typesMap.Store(key, types) return types, nil }) @@ -76,8 +87,8 @@ func (tc *typesCache) getByData(data interface{}) (string, error) { // get retrieves Types string from reflect.Type directly. // For test. -func (tc *typesCache) get(key reflect.Type) (string, bool) { - typesRaw, ok := tc.typesMap.Load(key) +func (mc *MethodCache) get(key methodKey) (string, bool) { + typesRaw, ok := mc.typesMap.Load(key) if !ok { return "", false } @@ -87,28 +98,24 @@ func (tc *typesCache) get(key reflect.Type) (string, bool) { // len returns the length of embedded sync.Map. // For test. -func (tc *typesCache) len() int { +func (mc *MethodCache) len() int { var length int - tc.typesMap.Range(func(key, value interface{}) bool { + mc.typesMap.Range(func(key, value interface{}) bool { length++ return true }) return length } -func GetTypes(data interface{}) (string, error) { - return cache.getByData(data) -} - // GetParamsTypeList is copied from dubbo-go, it should be rewritten -func getParamsTypeList(params []interface{}) (string, error) { +func getParamsTypeList(params []*parameter) (string, error) { var ( typ string types string ) for i := range params { - typ = getParamType(params[i]) + typ = params[i].getType() if typ == "" { return types, fmt.Errorf("cat not get arg %#v type", params[i]) } @@ -125,12 +132,119 @@ func getParamsTypeList(params []interface{}) (string, error) { return types, nil } -func getParamType(param interface{}) string { - if param == nil { +// parameter is used to store information about parameters. +// value stores the actual value of the parameter, and typeAnno records the type annotation added by IDL to this parameter. +type parameter struct { + value interface{} + typeAnno string +} + +// getType retrieves the parameter's type either through type annotation or by reflecting on the value. +func (p *parameter) getType() string { + if p == nil { + return "V" + } + + // Preferentially use the type specified in the type annotation. + if ta := p.getTypeByAnno(); len(ta) > 0 { + return ta + } + + return p.getTypeByValue() +} + +func (p *parameter) getTypeByAnno() string { + switch p.typeAnno { + // When the annotation is "-", it will be skipped, + // use the default parsing method without annotations. + case "-": + return "" + case "byte": + return "B" + case "byte[]": + return "[B" + case "Byte": + return "java.lang.Byte" + case "Byte[]": + return "[Ljava.lang.Byte;" + case "short": + return "S" + case "short[]": + return "[S" + case "Short": + return "java.lang.Short" + case "Short[]": + return "[Ljava.lang.Short;" + case "int": + return "I" + case "int[]": + return "[I" + case "Integer": + return "java.lang.Integer" + case "Integer[]": + return "[Ljava.lang.Integer;" + case "long": + return "J" + case "long[]": + return "[J" + case "Long": + return "java.lang.Long" + case "Long[]": + return "[Ljava.lang.Long;" + case "float": + return "F" + case "float[]": + return "[F" + case "Float": + return "java.lang.Float" + case "Float[]": + return "[Ljava.lang.Float;" + case "double": + return "D" + case "double[]": + return "[D" + case "Double": + return "java.lang.Double" + case "Double[]": + return "[Ljava.lang.Double;" + case "boolean": + return "Z" + case "boolean[]": + return "[Z" + case "Boolean": + return "java.lang.Boolean" + case "Boolean[]": + return "[Ljava.lang.Boolean;" + case "char": + return "C" + case "char[]": + return "[C" + case "Character": + return "java.lang.Character" + case "Character[]": + return "[Ljava.lang.Character;" + case "String": + return "java.lang.String" + case "String[]": + return "[Ljava.lang.String;" + case "Object": + return "java.lang.Object" + case "Object[]": + return "[Ljava.lang.Object;" + default: + if strings.HasSuffix(p.typeAnno, "[]") { + return "[L" + p.typeAnno[:len(p.typeAnno)-2] + ";" + } + return p.typeAnno + } +} + +func (p *parameter) getTypeByValue() string { + if p.value == nil { return "V" } - switch typ := param.(type) { + switch typ := p.value.(type) { // Serialized tags for base types case nil: return "V" diff --git a/pkg/hessian2/parameter_test.go b/pkg/hessian2/parameter_test.go index b3354b17..a9fba297 100644 --- a/pkg/hessian2/parameter_test.go +++ b/pkg/hessian2/parameter_test.go @@ -39,65 +39,74 @@ type testStructB struct { Internal *testInternalStruct } -func TestTypesCache_getByData(t *testing.T) { +type testStructC struct { + FieldA int8 + FieldB int64 + FieldC float64 + FieldD string + FieldE []int32 + FieldF []string +} + +func TestTypesCache_getTypes(t *testing.T) { tests := []struct { desc string - datum []interface{} - expected func(t *testing.T, c *typesCache) + datum []parameter + expected func(t *testing.T, c *MethodCache) }{ { desc: "same structs with basic Type", - datum: []interface{}{ - &testStructA{Field: 1}, - &testStructA{Field: 2}, + datum: []parameter{ + {value: &testStructA{Field: 1}}, + {value: &testStructA{Field: 2}}, }, - expected: func(t *testing.T, c *typesCache) { + expected: func(t *testing.T, c *MethodCache) { assert.Equal(t, 1, c.len()) data := &testStructA{Field: 3} - typ := reflect.ValueOf(data).Type() - types, ok := c.get(typ) + key := methodKey{typ: reflect.ValueOf(data).Type()} + types, ok := c.get(key) assert.Equal(t, true, ok) assert.Equal(t, "Ljava/lang/Byte;", types) }, }, { desc: "same structs with embedded Type", - datum: []interface{}{ - &testStructB{ + datum: []parameter{ + {value: &testStructB{ Internal: &testInternalStruct{ Field: 1, }, - }, - &testStructB{ + }}, + {value: &testStructB{ Internal: &testInternalStruct{ Field: 2, }, - }, + }}, }, - expected: func(t *testing.T, c *typesCache) { + expected: func(t *testing.T, c *MethodCache) { assert.Equal(t, 1, c.len()) data := &testStructB{ Internal: &testInternalStruct{ Field: 3, }, } - typ := reflect.ValueOf(data).Type() - types, ok := c.get(typ) + key := methodKey{typ: reflect.ValueOf(data).Type()} + types, ok := c.get(key) assert.Equal(t, true, ok) assert.Equal(t, "Ljava/lang/Object;", types) }, }, { desc: "different structs", - datum: []interface{}{ - &testStructA{Field: 1}, - &testStructB{ + datum: []parameter{ + {value: &testStructA{Field: 1}}, + {value: &testStructB{ Internal: &testInternalStruct{ Field: 2, }, - }, + }}, }, - expected: func(t *testing.T, c *typesCache) { + expected: func(t *testing.T, c *MethodCache) { assert.Equal(t, 2, c.len()) dataA := &testStructA{Field: 3} dataB := &testStructB{ @@ -105,27 +114,89 @@ func TestTypesCache_getByData(t *testing.T) { Field: 3, }, } - typA := reflect.ValueOf(dataA).Type() - typB := reflect.ValueOf(dataB).Type() - types, ok := c.get(typA) + keyA := methodKey{typ: reflect.ValueOf(dataA).Type()} + keyB := methodKey{typ: reflect.ValueOf(dataB).Type()} + types, ok := c.get(keyA) assert.Equal(t, true, ok) assert.Equal(t, "Ljava/lang/Byte;", types) - types, ok = c.get(typB) + types, ok = c.get(keyB) assert.Equal(t, true, ok) assert.Equal(t, "Ljava/lang/Object;", types) }, }, + { + desc: "use annotations to specify types", + datum: []parameter{ + { + value: &testStructA{Field: 1}, + typeAnno: "byte", + }, + { + value: &testStructB{ + Internal: &testInternalStruct{ + Field: 2, + }, + }, + typeAnno: "java.lang.Object", + }, + { + value: &testStructC{ + FieldA: 3, + FieldB: 4, + FieldC: 5.0, + FieldD: "6", + FieldE: []int32{7, 8}, + FieldF: []string{"9", "10"}, + }, + typeAnno: "byte,long,double,java.lang.String,int[],java.lang.String[]", + }, + { + value: &testStructC{ + FieldA: 3, + FieldB: 4, + FieldC: 5.0, + FieldD: "6", + FieldE: []int32{7, 8}, + FieldF: []string{"9", "10"}, + }, + typeAnno: "-,-,-,-,-,-", + }, + }, + expected: func(t *testing.T, c *MethodCache) { + assert.Equal(t, 4, c.len()) + + keyA := methodKey{typ: reflect.ValueOf(&testStructA{}).Type(), anno: "byte"} + types, ok := c.get(keyA) + assert.Equal(t, true, ok) + assert.Equal(t, "B", types) + + keyB := methodKey{typ: reflect.ValueOf(&testStructB{}).Type(), anno: "java.lang.Object"} + types, ok = c.get(keyB) + assert.Equal(t, true, ok) + assert.Equal(t, "Ljava/lang/Object;", types) + + keyC := methodKey{typ: reflect.ValueOf(&testStructC{}).Type(), anno: "byte,long,double,java.lang.String,int[],java.lang.String[]"} + types, ok = c.get(keyC) + assert.Equal(t, true, ok) + assert.Equal(t, "BJDLjava/lang/String;[I[Ljava/lang/String;", types) + + keyD := methodKey{typ: reflect.ValueOf(&testStructC{}).Type(), anno: "-,-,-,-,-,-"} + types, ok = c.get(keyD) + assert.Equal(t, true, ok) + assert.Equal(t, "Ljava/lang/Byte;Ljava/lang/Long;Ljava/lang/Double;Ljava/lang/String;Ljava/util/List;Ljava/util/List;", types) + }, + }, } for _, test := range tests { t.Run(test.desc, func(t *testing.T) { - tc := new(typesCache) + tc := new(MethodCache) // run getByData concurrently for i, data := range test.datum { testData := data t.Run(fmt.Sprintf("struct%d", i), func(t *testing.T) { t.Parallel() - _, err := tc.getByData(testData) + _, err := tc.GetTypes(testData.value, NewTypeAnnotation(testData.typeAnno)) if err != nil { t.Fatal(err) } diff --git a/pkg/hessian2/utils.go b/pkg/hessian2/utils.go index c548438b..53d6f0dd 100644 --- a/pkg/hessian2/utils.go +++ b/pkg/hessian2/utils.go @@ -27,7 +27,6 @@ import ( "bytes" "errors" "fmt" - "reflect" "runtime" "runtime/debug" "sync" @@ -73,8 +72,8 @@ type call struct { // The only difference between this Group and golang.org/x/sync/singleflight is that key is reflect.Type // cause reflect.Type.String() could not be guaranteed to be unique. type Group struct { - mu sync.Mutex // protects m - m map[reflect.Type]*call // lazily initialized + mu sync.Mutex // protects m + m map[methodKey]*call // lazily initialized } type Result struct { @@ -83,10 +82,10 @@ type Result struct { Shared bool } -func (g *Group) Do(key reflect.Type, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { +func (g *Group) Do(key methodKey, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { g.mu.Lock() if g.m == nil { - g.m = make(map[reflect.Type]*call) + g.m = make(map[methodKey]*call) } if c, ok := g.m[key]; ok { c.dups++ @@ -109,11 +108,11 @@ func (g *Group) Do(key reflect.Type, fn func() (interface{}, error)) (v interfac return c.val, c.err, c.dups > 0 } -func (g *Group) DoChan(key reflect.Type, fn func() (interface{}, error)) <-chan Result { +func (g *Group) DoChan(key methodKey, fn func() (interface{}, error)) <-chan Result { ch := make(chan Result, 1) g.mu.Lock() if g.m == nil { - g.m = make(map[reflect.Type]*call) + g.m = make(map[methodKey]*call) } if c, ok := g.m[key]; ok { c.dups++ @@ -131,7 +130,7 @@ func (g *Group) DoChan(key reflect.Type, fn func() (interface{}, error)) <-chan return ch } -func (g *Group) doCall(c *call, key reflect.Type, fn func() (interface{}, error)) { +func (g *Group) doCall(c *call, key methodKey, fn func() (interface{}, error)) { normalReturn := false recovered := false @@ -194,7 +193,7 @@ func (g *Group) doCall(c *call, key reflect.Type, fn func() (interface{}, error) } } -func (g *Group) Forget(key reflect.Type) { +func (g *Group) Forget(key methodKey) { g.mu.Lock() if c, ok := g.m[key]; ok { c.forgotten = true diff --git a/pkg/options.go b/pkg/options.go index 943d57f2..37c3bfd1 100644 --- a/pkg/options.go +++ b/pkg/options.go @@ -19,8 +19,14 @@ package dubbo +import ( + "github.com/cloudwego/thriftgo/thrift_reflection" + "github.com/kitex-contrib/codec-dubbo/pkg/hessian2" +) + type Options struct { - JavaClassName string + JavaClassName string + TypeAnnotations map[string]*hessian2.TypeAnnotation } func (o *Options) Apply(opts []Option) { @@ -50,3 +56,35 @@ func WithJavaClassName(name string) Option { o.JavaClassName = name }} } + +// WithFileDescriptor provides method annotations for DubboCodec. Adding method +// annotations allows specifying the Java types for DubboCodec encoding. +func WithFileDescriptor(fd *thrift_reflection.FileDescriptor) Option { + if fd == nil { + panic("Please pass in a valid FileDescriptor.") + } + + return Option{F: func(o *Options) { + o.TypeAnnotations = extractAnnotations(fd) + }} +} + +// extractAnnotations extracts method annotations from the given FileDescriptor +// and returns them as a map. These annotations allow specifying Java types for DubboCodec encoding. +// The annotation format is (hessian.argsType="arg1_type,arg2_type,arg3_type,..."), +// use an empty string or "-" as arg_type to use the default parsing method. +func extractAnnotations(fd *thrift_reflection.FileDescriptor) map[string]*hessian2.TypeAnnotation { + annotations := make(map[string]*hessian2.TypeAnnotation) + + for _, svc := range fd.GetServices() { + prefix := svc.GetName() + "." + + for _, m := range svc.GetMethods() { + annos := m.GetAnnotations() + if v, ok := annos[hessian2.HESSIAN_ARGS_TYPE_TAG]; ok && len(v) > 0 { + annotations[prefix+m.GetName()] = hessian2.NewTypeAnnotation(v[0]) + } + } + } + return annotations +} diff --git a/tests/crosstest/go.mod b/tests/crosstest/go.mod index 303a0234..67372e14 100644 --- a/tests/crosstest/go.mod +++ b/tests/crosstest/go.mod @@ -5,6 +5,7 @@ go 1.20 require ( dubbo.apache.org/dubbo-go/v3 v3.1.0 github.com/cloudwego/kitex v0.6.2-0.20230815060351-88ea60530d40 + github.com/kitex-contrib/codec-dubbo v0.0.0-20230817144706-07db3a9b55f8 github.com/kitex-contrib/codec-dubbo/tests/kitex v0.0.0 helloworld v0.0.0 ) @@ -85,7 +86,6 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k0kubun/pp v3.0.1+incompatible // indirect - github.com/kitex-contrib/codec-dubbo v0.0.0-20230817144706-07db3a9b55f8 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/knadh/koanf v1.5.0 // indirect github.com/leodido/go-urn v1.2.2 // indirect diff --git a/tests/crosstest/go.sum b/tests/crosstest/go.sum index 876ce456..9bac16e9 100644 --- a/tests/crosstest/go.sum +++ b/tests/crosstest/go.sum @@ -1010,8 +1010,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kitex-contrib/codec-dubbo v0.0.0-20230817144706-07db3a9b55f8 h1:42uzavvCmLf61IWLYil6VRoMlAW1/psFzs1E6vp5r8o= -github.com/kitex-contrib/codec-dubbo v0.0.0-20230817144706-07db3a9b55f8/go.mod h1:z9Gbl+xG+qsnqQ7jCYqWdHb53WluDpW+/QE/SNvd62U= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= @@ -1468,8 +1466,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1599,7 +1597,6 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= @@ -1764,9 +1761,9 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1792,9 +1789,9 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/tests/crosstest/kitex2dubbo/base_type_test.go b/tests/crosstest/kitex2dubbo/base_type_test.go index 8eea2391..5cb4b33e 100644 --- a/tests/crosstest/kitex2dubbo/base_type_test.go +++ b/tests/crosstest/kitex2dubbo/base_type_test.go @@ -30,6 +30,7 @@ import ( _ "dubbo.apache.org/dubbo-go/v3/imports" "github.com/cloudwego/kitex/client" dubbo "github.com/kitex-contrib/codec-dubbo/pkg" + "github.com/kitex-contrib/codec-dubbo/tests/kitex/kitex_gen/echo" "github.com/kitex-contrib/codec-dubbo/tests/kitex/kitex_gen/echo/testservice" ) @@ -53,7 +54,7 @@ func TestMain(m *testing.M) { go runDubboGoServer(exitChan) cancel := runDubboJavaServer() // wait for dubbo-go and dubbo-java server initialization - time.Sleep(15 * time.Second) + time.Sleep(5 * time.Second) var err error cli2Go, err = testservice.NewClient("test", client.WithHostPorts("127.0.0.1:20000"), @@ -68,6 +69,7 @@ func TestMain(m *testing.M) { client.WithHostPorts("127.0.0.1:20001"), client.WithCodec(dubbo.NewDubboCodec( dubbo.WithJavaClassName("org.apache.dubbo.tests.api.UserProvider"), + dubbo.WithFileDescriptor(echo.GetFileDescriptorForApi()), )), ) if err != nil { diff --git a/tests/crosstest/kitex2dubbo/container_type_test.go b/tests/crosstest/kitex2dubbo/container_type_test.go index 548c9429..a2351c86 100644 --- a/tests/crosstest/kitex2dubbo/container_type_test.go +++ b/tests/crosstest/kitex2dubbo/container_type_test.go @@ -156,18 +156,18 @@ func TestEchoBoolList_Java(t *testing.T) { } // dubbo-java -> dubbo-java does not support -//func TestEchoByteList_Java(t *testing.T) { -// var req = []int8{1, 2} -// resp, err := cli2Java.EchoByteList(context.Background(), req) -// assertEcho(t, err, req, resp) -//} +// func TestEchoByteList_Java(t *testing.T) { +// var req = []int8{1, 2} +// resp, err := cli2Java.EchoByteList(context.Background(), req) +// assertEcho(t, err, req, resp) +// } // dubbo-java -> dubbo-java does not support -//func TestEchoInt16List_Java(t *testing.T) { -// var req = []int16{1, 2} -// resp, err := cli2Java.EchoInt16List(context.Background(), req) -// assertEcho(t, err, req, resp) -//} +// func TestEchoInt16List_Java(t *testing.T) { +// var req = []int16{1, 2} +// resp, err := cli2Java.EchoInt16List(context.Background(), req) +// assertEcho(t, err, req, resp) +// } func TestEchoInt32List_Java(t *testing.T) { req := []int32{1, 2} @@ -208,22 +208,22 @@ func TestEchoBool2BoolMap_Java(t *testing.T) { } // dubbo-java -> dubbo-java does not support -//func TestEchoBool2ByteMap_Java(t *testing.T) { -// req := map[bool]int8{ -// true: 1, -// } -// resp, err := cli2Java.EchoBool2ByteMap(context.Background(), req) -// assertEcho(t, err, req, resp) -//} +// func TestEchoBool2ByteMap_Java(t *testing.T) { +// req := map[bool]int8{ +// true: 1, +// } +// resp, err := cli2Java.EchoBool2ByteMap(context.Background(), req) +// assertEcho(t, err, req, resp) +// } // dubbo-java -> dubbo-java does not support -//func TestEchoBool2Int16Map_Java(t *testing.T) { -// req := map[bool]int16{ -// true: 1, -// } -// resp, err := cli2Java.EchoBool2Int16Map(context.Background(), req) -// assertEcho(t, err, req, resp) -//} +// func TestEchoBool2Int16Map_Java(t *testing.T) { +// req := map[bool]int16{ +// true: 1, +// } +// resp, err := cli2Java.EchoBool2Int16Map(context.Background(), req) +// assertEcho(t, err, req, resp) +// } func TestEchoBool2Int32Map_Java(t *testing.T) { req := map[bool]int32{ diff --git a/tests/crosstest/kitex2dubbo/method_annotation_test.go b/tests/crosstest/kitex2dubbo/method_annotation_test.go new file mode 100644 index 00000000..616995d0 --- /dev/null +++ b/tests/crosstest/kitex2dubbo/method_annotation_test.go @@ -0,0 +1,222 @@ +/* + * Copyright 2023 CloudWeGo Authors + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kitex2dubbo + +import ( + "context" + "testing" +) + +// ----------kitex -> dubbo-java---------- + +func TestEchoBaseBool_Java(t *testing.T) { + req := true + resp, err := cli2Java.EchoBaseBool(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseByte_Java(t *testing.T) { + req := int8(1) + resp, err := cli2Java.EchoBaseByte(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseInt16_Java(t *testing.T) { + req := int16(1) + resp, err := cli2Java.EchoBaseInt16(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseInt32_Java(t *testing.T) { + req := int32(1) + resp, err := cli2Java.EchoBaseInt32(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseInt64_Java(t *testing.T) { + req := int64(1) + resp, err := cli2Java.EchoBaseInt64(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseDouble_Java(t *testing.T) { + req := 1.0 + resp, err := cli2Java.EchoBaseDouble(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseBoolList_Java(t *testing.T) { + req := []bool{true, false} + resp, err := cli2Java.EchoBaseBoolList(context.Background(), req) + assertEcho(t, err, req, resp) +} + +// dubbo-java -> dubbo-java does not support +// func TestEchoBaseByteList_Java(t *testing.T) { +// var req = []int8{1, 2} +// resp, err := cli2Java.EchoBaseByteList(context.Background(), req) +// assertEcho(t, err, req, resp) +// } + +func TestEchoBaseInt16List_Java(t *testing.T) { + req := []int16{1, 2} + resp, err := cli2Java.EchoBaseInt16List(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseInt32List_Java(t *testing.T) { + req := []int32{1, 2} + resp, err := cli2Java.EchoBaseInt32List(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseInt64List_Java(t *testing.T) { + req := []int64{1, 2} + resp, err := cli2Java.EchoBaseInt64List(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBaseDoubleList_Java(t *testing.T) { + req := []float64{12.3456, 78.9012} + resp, err := cli2Java.EchoBaseDoubleList(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2BoolBaseMap_Java(t *testing.T) { + req := map[bool]bool{ + true: true, + } + resp, err := cli2Java.EchoBool2BoolBaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2ByteBaseMap_Java(t *testing.T) { + req := map[bool]int8{ + true: 1, + } + resp, err := cli2Java.EchoBool2ByteBaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2Int16BaseMap_Java(t *testing.T) { + req := map[bool]int16{ + true: 1, + } + resp, err := cli2Java.EchoBool2Int16BaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2Int32BaseMap_Java(t *testing.T) { + req := map[bool]int32{ + true: 1, + } + resp, err := cli2Java.EchoBool2Int32BaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2Int64BaseMap_Java(t *testing.T) { + req := map[bool]int64{ + true: 1, + } + resp, err := cli2Java.EchoBool2Int64BaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoBool2DoubleBaseMap_Java(t *testing.T) { + req := map[bool]float64{ + true: 12.34, + } + resp, err := cli2Java.EchoBool2DoubleBaseMap(context.Background(), req) + assertEcho(t, err, req, resp) +} + +func TestEchoMultiBaseBool_Java(t *testing.T) { + baseReq := true + listReq := []bool{true, true} + mapReq := map[bool]bool{ + true: true, + } + resp, err := cli2Java.EchoMultiBaseBool(context.Background(), baseReq, listReq, mapReq) + assertEcho(t, err, baseReq, resp.BaseResp) + assertEcho(t, err, listReq, resp.ListResp) + assertEcho(t, err, mapReq, resp.MapResp) +} + +// hessian2.Decode does not support but dubbo-java supports +// func TestEchoMultiBaseByte_Java(t *testing.T) { +// baseReq := int8(1) +// listReq := []int8{12, 34} +// mapReq := map[int8]int8{ +// 12: 34, +// } +// resp, err := cli2Java.EchoMultiBaseByte(context.Background(), baseReq, listReq, mapReq) +// assertEcho(t, err, baseReq, resp.BaseResp) +// assertEcho(t, err, listReq, resp.ListResp) +// assertEcho(t, err, mapReq, resp.MapResp) +// } + +// hessian2.Decode does not support but dubbo-java supports +// func TestEchoMultiBaseInt16_Java(t *testing.T) { +// baseReq := int16(1) +// listReq := []int16{12, 34} +// mapReq := map[int16]int16{ +// 12: 34, +// } +// resp, err := cli2Java.EchoMultiBaseInt16(context.Background(), baseReq, listReq, mapReq) +// assertEcho(t, err, baseReq, resp.BaseResp) +// assertEcho(t, err, listReq, resp.ListResp) +// assertEcho(t, err, mapReq, resp.MapResp) +// } + +func TestEchoMultiBaseInt32_Java(t *testing.T) { + baseReq := int32(1) + listReq := []int32{12, 34} + mapReq := map[int32]int32{ + 12: 34, + } + resp, err := cli2Java.EchoMultiBaseInt32(context.Background(), baseReq, listReq, mapReq) + assertEcho(t, err, baseReq, resp.BaseResp) + assertEcho(t, err, listReq, resp.ListResp) + assertEcho(t, err, mapReq, resp.MapResp) +} + +func TestEchoMultiBaseInt64_Java(t *testing.T) { + baseReq := int64(1) + listReq := []int64{12, 34} + mapReq := map[int64]int64{ + 12: 34, + } + resp, err := cli2Java.EchoMultiBaseInt64(context.Background(), baseReq, listReq, mapReq) + assertEcho(t, err, baseReq, resp.BaseResp) + assertEcho(t, err, listReq, resp.ListResp) + assertEcho(t, err, mapReq, resp.MapResp) +} + +func TestEchoMultiBaseDouble_Java(t *testing.T) { + baseReq := 12.34 + listReq := []float64{12.34, 56.78} + mapReq := map[float64]float64{ + 12.34: 56.78, + } + resp, err := cli2Java.EchoMultiBaseDouble(context.Background(), baseReq, listReq, mapReq) + assertEcho(t, err, baseReq, resp.BaseResp) + assertEcho(t, err, listReq, resp.ListResp) + assertEcho(t, err, mapReq, resp.MapResp) +} diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiBoolResponse.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiBoolResponse.java index de90cdb7..8c5c723a 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiBoolResponse.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiBoolResponse.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public boolean[] getListRespToArray() { + boolean[] arr = new boolean[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiByteResponse.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiByteResponse.java index 139b684e..ad4807ee 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiByteResponse.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiByteResponse.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public byte[] getListRespToArray() { + byte[] arr = new byte[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiDoubleResponse.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiDoubleResponse.java index 9fcd9602..a5af1983 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiDoubleResponse.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiDoubleResponse.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public double[] getListRespToArray() { + double[] arr = new double[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt16Response.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt16Response.java index 122d34f2..ebfe2173 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt16Response.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt16Response.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public short[] getListRespToArray() { + short[] arr = new short[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt32Response.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt32Response.java index f9ca5539..a52428f8 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt32Response.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt32Response.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public int[] getListRespToArray() { + int[] arr = new int[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt64Response.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt64Response.java index 3ce78613..ef21ec57 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt64Response.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/EchoMultiInt64Response.java @@ -23,6 +23,14 @@ public List getListResp() { return listResp; } + public long[] getListRespToArray() { + long[] arr = new long[listResp.size()]; + for (int i = 0; i < listResp.size(); i++) { + arr[i] = listResp.get(i); + } + return arr; + } + public Map getMapResp() { return mapResp; } diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/UserProvider.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/UserProvider.java index a48561fe..f69b95b7 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/UserProvider.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/api/UserProvider.java @@ -19,6 +19,7 @@ package org.apache.dubbo.tests.api; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -85,4 +86,52 @@ public interface UserProvider { EchoMultiDoubleResponse EchoMultiDouble(Double baseReq, List listReq, Map mapReq) throws Exception; EchoMultiStringResponse EchoMultiString(String baseReq, List listReq, Map mapReq) throws Exception; + + boolean EchoBaseBool(boolean req) throws Exception; + + byte EchoBaseByte(byte req) throws Exception; + + short EchoBaseInt16(short req) throws Exception; + + int EchoBaseInt32(int req) throws Exception; + + long EchoBaseInt64(long req) throws Exception; + + double EchoBaseDouble(double req) throws Exception; + + boolean[] EchoBaseBoolList(boolean[] req) throws Exception; + + byte[] EchoBaseByteList(byte[] req) throws Exception; + + short[] EchoBaseInt16List(short[] req) throws Exception; + + int[] EchoBaseInt32List(int[] req) throws Exception; + + long[] EchoBaseInt64List(long[] req) throws Exception; + + double[] EchoBaseDoubleList(double[] req) throws Exception; + + HashMap EchoBool2BoolBaseMap(HashMap req) throws Exception; + + HashMap EchoBool2ByteBaseMap(HashMap req) throws Exception; + + HashMap EchoBool2Int16BaseMap(HashMap req) throws Exception; + + HashMap EchoBool2Int32BaseMap(HashMap req) throws Exception; + + HashMap EchoBool2Int64BaseMap(HashMap req) throws Exception; + + HashMap EchoBool2DoubleBaseMap(HashMap req) throws Exception; + + EchoMultiBoolResponse EchoMultiBaseBool(boolean baseReq, boolean[] listReq, HashMap mapReq) throws Exception; + + EchoMultiByteResponse EchoMultiBaseByte(byte baseReq, byte[] listReq, HashMap mapReq) throws Exception; + + EchoMultiInt16Response EchoMultiBaseInt16(short baseReq, short[] listReq, HashMap mapReq) throws Exception; + + EchoMultiInt32Response EchoMultiBaseInt32(int baseReq, int[] listReq, HashMap mapReq) throws Exception; + + EchoMultiInt64Response EchoMultiBaseInt64(long baseReq,long[] listReq, HashMap mapReq) throws Exception; + + EchoMultiDoubleResponse EchoMultiBaseDouble(double baseReq, double[] listReq, HashMap mapReq) throws Exception; } \ No newline at end of file diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/client/Application.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/client/Application.java index e8ae91c3..f373dcf8 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/client/Application.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/client/Application.java @@ -42,6 +42,7 @@ public static void main(String[] args) throws IOException { testContainerListType(service); testContainerMapType(service); testMultiParams(service); + testMethodAnnotation(service); } public static void logEchoFail(String methodName) { @@ -58,8 +59,8 @@ public static void logEchoEnd(String methodName) { public static void testBaseTypes(UserProvider svc) { testEchoBool(svc); - testEchoByte(svc); - testEchoInt16(svc); +// testEchoByte(svc); +// testEchoInt16(svc); testEchoInt32(svc); testEchoInt64(svc); testEchoDouble(svc); @@ -80,13 +81,13 @@ public static void testContainerListType(UserProvider svc) { public static void testContainerMapType(UserProvider svc) { testEchoBool2BoolMap(svc); - testEchoBool2ByteMap(svc); - testEchoBool2Int16Map(svc); +// testEchoBool2ByteMap(svc); +// testEchoBool2Int16Map(svc); testEchoBool2Int32Map(svc); testEchoBool2Int64Map(svc); testEchoBool2DoubleMap(svc); testEchoBool2StringMap(svc); - testEchoBool2BinaryMap(svc); +// testEchoBool2BinaryMap(svc); } public static void testMultiParams(UserProvider svc) { @@ -99,6 +100,34 @@ public static void testMultiParams(UserProvider svc) { testEchoMultiString(svc); } + public static void testMethodAnnotation(UserProvider svc) { + testEchoBaseBool(svc); + testEchoBaseByte(svc); + testEchoBaseInt16(svc); + testEchoBaseInt32(svc); + testEchoBaseInt64(svc); + testEchoBaseDouble(svc); + testEchoBaseBoolList(svc); + testEchoBaseByteList(svc); + testEchoBaseInt16List(svc); + testEchoBaseInt32List(svc); + testEchoBaseInt64List(svc); + testEchoBaseDoubleList(svc); + testEchoBool2BoolBaseMap(svc); +// testEchoBool2ByteBaseMap(svc); +// testEchoBool2Int16BaseMap(svc); + testEchoBool2Int32BaseMap(svc); + testEchoBool2Int64BaseMap(svc); + testEchoBool2DoubleBaseMap(svc); + testEchoMultiBaseBool(svc); + testEchoMultiBaseByte(svc); + testEchoMultiBaseInt16(svc); + testEchoMultiBaseInt32(svc); + testEchoMultiBaseInt64(svc); + testEchoMultiBaseDouble(svc); + + } + public static void testEchoBool(UserProvider svc) { String methodName = "EchoBool"; try { @@ -585,4 +614,364 @@ public static void testEchoMultiString(UserProvider svc) { } logEchoEnd(methodName); } + + public static void testEchoBaseBool(UserProvider svc) { + String methodName = "EchoBaseBool"; + try { + boolean req = true; + boolean resp = svc.EchoBaseBool(req); + if (req != resp) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseByte(UserProvider svc) { + String methodName = "EchoBaseByte"; + try { + Byte req = '1'; + Byte resp = svc.EchoBaseByte(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt16(UserProvider svc) { + String methodName = "EchoBaseInt16"; + try { + Short req = 12; + Short resp = svc.EchoBaseInt16(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt32(UserProvider svc) { + String methodName = "EchoBaseInt32"; + try { + Integer req = 12; + Integer resp = svc.EchoBaseInt32(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt64(UserProvider svc) { + String methodName = "EchoBaseInt64"; + try { + Long req = 12L; + Long resp = svc.EchoBaseInt64(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseDouble(UserProvider svc) { + String methodName = "EchoBaseDouble"; + try { + Double req = 12.34; + Double resp = svc.EchoBaseDouble(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseBoolList(UserProvider svc) { + String methodName = "EchoBaseBoolList"; + try { + boolean[] req = {true, false}; + boolean[] resp = svc.EchoBaseBoolList(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseByteList(UserProvider svc) { + String methodName = "EchoBaseByteList"; + try { + byte[] req = {1, 2}; + byte[] resp = svc.EchoBaseByteList(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt16List(UserProvider svc) { + String methodName = "EchoBaseInt16List"; + try { + short[] req = {1, 2}; + short[] resp = svc.EchoBaseInt16List(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt32List(UserProvider svc) { + String methodName = "EchoBaseInt32List"; + try { + int[] req = {1, 2}; + int[] resp = svc.EchoBaseInt32List(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseInt64List(UserProvider svc) { + String methodName = "EchoBaseInt64List"; + try { + long[] req = {1, 2}; + long[] resp = svc.EchoBaseInt64List(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBaseDoubleList(UserProvider svc) { + String methodName = "EchoBaseDoubleList"; + try { + double[] req = {1.2, 3.4}; + double[] resp = svc.EchoBaseDoubleList(req); + if (!Arrays.equals(req, resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2BoolBaseMap(UserProvider svc) { + String methodName = "EchoBool2BoolBaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, true); + Map resp = svc.EchoBool2BoolBaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2ByteBaseMap(UserProvider svc) { + String methodName = "EchoBool2ByteBaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, (byte) 12); + Map resp = svc.EchoBool2ByteBaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2Int16BaseMap(UserProvider svc) { + String methodName = "EchoBool2Int16BaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, (short) 12); + Map resp = svc.EchoBool2Int16BaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2Int32BaseMap(UserProvider svc) { + String methodName = "EchoBool2Int32BaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, 1); + Map resp = svc.EchoBool2Int32BaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2Int64BaseMap(UserProvider svc) { + String methodName = "EchoBool2Int64BaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, (long) 1); + Map resp = svc.EchoBool2Int64BaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoBool2DoubleBaseMap(UserProvider svc) { + String methodName = "EchoBool2DoubleBaseMap"; + try { + HashMap req = new HashMap<>(); + req.put(true, 12.34); + Map resp = svc.EchoBool2DoubleBaseMap(req); + if (!req.equals(resp)) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseBool(UserProvider svc) { + String methodName = "EchoMultiBaseBool"; + try { + boolean baseReq = true; + boolean[] listReq = {true, false}; + HashMap mapReq = new HashMap<>(); + mapReq.put(true, true); + EchoMultiBoolResponse resp = svc.EchoMultiBaseBool(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseByte(UserProvider svc) { + String methodName = "EchoMultiBaseByte"; + try { + byte baseReq = 1; + byte[] listReq = {12, 34}; + HashMap mapReq = new HashMap<>(); + mapReq.put((byte) 12, (byte) 34); + EchoMultiByteResponse resp = svc.EchoMultiBaseByte(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseInt16(UserProvider svc) { + String methodName = "EchoMultiBaseInt16"; + try { + short baseReq = 1; + short[] listReq = {12, 34}; + HashMap mapReq = new HashMap<>(); + mapReq.put((short) 12, (short) 34); + EchoMultiInt16Response resp = svc.EchoMultiBaseInt16(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseInt32(UserProvider svc) { + String methodName = "EchoMultiBaseInt32"; + try { + int baseReq = 1; + int[] listReq = {12, 34}; + HashMap mapReq = new HashMap<>(); + mapReq.put(12, 34); + EchoMultiInt32Response resp = svc.EchoMultiBaseInt32(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseInt64(UserProvider svc) { + String methodName = "EchoMultiBaseInt64"; + try { + long baseReq = 1; + long[] listReq = {12, 34}; + HashMap mapReq = new HashMap<>(); + mapReq.put((long) 12, (long) 34); + EchoMultiInt64Response resp = svc.EchoMultiBaseInt64(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } + + public static void testEchoMultiBaseDouble(UserProvider svc) { + String methodName = "EchoMultiBaseDouble"; + try { + double baseReq = 12.34; + double[] listReq = {12.34, 56.78}; + HashMap mapReq = new HashMap<>(); + mapReq.put(12.34, 56.78); + EchoMultiDoubleResponse resp = svc.EchoMultiBaseDouble(baseReq, listReq, mapReq); + if (baseReq != resp.getBaseResp() || !Arrays.equals(listReq, resp.getListRespToArray()) || !mapReq.equals(resp.getMapResp())) { + logEchoFail(methodName); + } + } catch (Exception e) { + logEchoException(methodName, e); + } + logEchoEnd(methodName); + } } \ No newline at end of file diff --git a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/provider/UserProviderImpl.java b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/provider/UserProviderImpl.java index b90b67c5..9594b088 100644 --- a/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/provider/UserProviderImpl.java +++ b/tests/dubbo-java/src/main/java/org/apache/dubbo/tests/provider/UserProviderImpl.java @@ -21,6 +21,8 @@ import org.apache.dubbo.tests.api.*; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; import java.util.List; @@ -179,4 +181,137 @@ public EchoMultiDoubleResponse EchoMultiDouble(Double baseReq, List list public EchoMultiStringResponse EchoMultiString(String baseReq, List listReq, Map mapReq) throws Exception { return new EchoMultiStringResponse(baseReq, listReq, mapReq); } + + + @Override + public boolean EchoBaseBool(boolean req) throws Exception { + return req; + } + + @Override + public byte EchoBaseByte(byte req) throws Exception { + return req; + } + + @Override + public short EchoBaseInt16(short req) throws Exception { + return req; + } + + @Override + public int EchoBaseInt32(int req) throws Exception { + return req; + } + + @Override + public long EchoBaseInt64(long req) throws Exception { + return req; + } + + @Override + public double EchoBaseDouble(double req) throws Exception { + return req; + } + + @Override + public boolean[] EchoBaseBoolList(boolean[] req) throws Exception { + return req; + } + + @Override + public byte[] EchoBaseByteList(byte[] req) throws Exception { + return req; + } + + @Override + public short[] EchoBaseInt16List(short[] req) throws Exception { + return req; + } + + @Override + public int[] EchoBaseInt32List(int[] req) throws Exception { + return req; + } + + @Override + public long[] EchoBaseInt64List(long[] req) throws Exception { + return req; + } + + @Override + public double[] EchoBaseDoubleList(double[] req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2BoolBaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2ByteBaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2Int16BaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2Int32BaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2Int64BaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public HashMap EchoBool2DoubleBaseMap(HashMap req) throws Exception { + return req; + } + + @Override + public EchoMultiBoolResponse EchoMultiBaseBool(boolean baseReq, boolean[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (boolean b : listReq) arr.add(b); + return new EchoMultiBoolResponse(baseReq, arr, mapReq); + } + + @Override + public EchoMultiByteResponse EchoMultiBaseByte(byte baseReq, byte[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (byte b : listReq) arr.add(b); + return new EchoMultiByteResponse(baseReq, arr, mapReq); + } + + @Override + public EchoMultiInt16Response EchoMultiBaseInt16(short baseReq, short[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (short s : listReq) arr.add(s); + return new EchoMultiInt16Response(baseReq, arr, mapReq); + } + + @Override + public EchoMultiInt32Response EchoMultiBaseInt32(int baseReq, int[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (int i : listReq) arr.add(i); + return new EchoMultiInt32Response(baseReq, arr, mapReq); + } + + @Override + public EchoMultiInt64Response EchoMultiBaseInt64(long baseReq, long[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (long l : listReq) arr.add(l); + return new EchoMultiInt64Response(baseReq, arr, mapReq); + } + + @Override + public EchoMultiDoubleResponse EchoMultiBaseDouble(double baseReq, double[] listReq, HashMap mapReq) throws Exception { + ArrayList arr = new ArrayList<>(); + for (double d : listReq) arr.add(d); + return new EchoMultiDoubleResponse(baseReq, arr, mapReq); + } } \ No newline at end of file diff --git a/tests/kitex/api.thrift b/tests/kitex/api.thrift index bac71428..39fafe59 100644 --- a/tests/kitex/api.thrift +++ b/tests/kitex/api.thrift @@ -103,4 +103,30 @@ service TestService { EchoMultiInt64Response EchoMultiInt64(1: i64 baseReq, 2: list listReq, 3: map mapReq) EchoMultiDoubleResponse EchoMultiDouble(1: double baseReq, 2: list listReq, 3: map mapReq) EchoMultiStringResponse EchoMultiString(1: string baseReq, 2: list listReq, 3: map mapReq) + + // method annotation + bool EchoBaseBool(1: bool req) (hessian.argsType="boolean") + byte EchoBaseByte(1: byte req) (hessian.argsType="byte") + i16 EchoBaseInt16(1: i16 req) (hessian.argsType="short") + i32 EchoBaseInt32(1: i32 req) (hessian.argsType="int") + i64 EchoBaseInt64(1: i64 req) (hessian.argsType="long") + double EchoBaseDouble(1: double req) (hessian.argsType="double") + list EchoBaseBoolList(1: list req) (hessian.argsType="boolean[]") + list EchoBaseByteList(1: list req) (hessian.argsType="byte[]") + list EchoBaseInt16List(1: list req) (hessian.argsType="short[]") + list EchoBaseInt32List(1: list req) (hessian.argsType="int[]") + list EchoBaseInt64List(1: list req) (hessian.argsType="long[]") + list EchoBaseDoubleList(1: list req) (hessian.argsType="double[]") + map EchoBool2BoolBaseMap(1: map req) (hessian.argsType="java.util.HashMap") + map EchoBool2ByteBaseMap(1: map req) (hessian.argsType="java.util.HashMap") + map EchoBool2Int16BaseMap(1: map req) (hessian.argsType="java.util.HashMap") + map EchoBool2Int32BaseMap(1: map req) (hessian.argsType="java.util.HashMap") + map EchoBool2Int64BaseMap(1: map req) (hessian.argsType="java.util.HashMap") + map EchoBool2DoubleBaseMap(1: map req) (hessian.argsType="java.util.HashMap") + EchoMultiBoolResponse EchoMultiBaseBool(1: bool baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="boolean,boolean[],java.util.HashMap") + EchoMultiByteResponse EchoMultiBaseByte(1: byte baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="byte,byte[],java.util.HashMap") + EchoMultiInt16Response EchoMultiBaseInt16(1: i16 baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="short,short[],java.util.HashMap") + EchoMultiInt32Response EchoMultiBaseInt32(1: i32 baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="int,int[],java.util.HashMap") + EchoMultiInt64Response EchoMultiBaseInt64(1: i64 baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="long,long[],java.util.HashMap") + EchoMultiDoubleResponse EchoMultiBaseDouble(1: double baseReq, 2: list listReq, 3: map mapReq) (hessian.argsType="double,double[],java.util.HashMap") }(JavaClassName="org.apache.dubbo.tests.api.UserProvider") diff --git a/tests/kitex/client/client.go b/tests/kitex/client/client.go index 88734ca3..9c9417fd 100644 --- a/tests/kitex/client/client.go +++ b/tests/kitex/client/client.go @@ -7,6 +7,7 @@ import ( "github.com/cloudwego/kitex/client" "github.com/cloudwego/kitex/pkg/klog" + "github.com/kitex-contrib/codec-dubbo/tests/kitex/kitex_gen/echo" "github.com/kitex-contrib/codec-dubbo/tests/kitex/kitex_gen/echo/testservice" ) @@ -15,12 +16,19 @@ func main() { client.WithHostPorts("127.0.0.1:20000"), client.WithCodec(dubbo.NewDubboCodec( dubbo.WithJavaClassName("org.apache.dubbo.tests.api.UserProvider"), + dubbo.WithFileDescriptor(echo.GetFileDescriptorForApi()), )), ) if err != nil { panic(err) } + res, err := cli.EchoBaseBool(context.Background(), true) + if err != nil { + panic(err) + } + klog.Infof("res: %v", res) + resp, err := cli.EchoInt(context.Background(), 0x12345678) if err != nil { panic(err) diff --git a/tests/kitex/go.mod b/tests/kitex/go.mod index db64c913..23d58c3f 100644 --- a/tests/kitex/go.mod +++ b/tests/kitex/go.mod @@ -5,6 +5,7 @@ go 1.18 require ( github.com/apache/thrift v0.13.0 github.com/cloudwego/kitex v0.6.2-0.20230815060351-88ea60530d40 + github.com/cloudwego/thriftgo v0.3.0 github.com/kitex-contrib/codec-dubbo v0.0.0-20230817144706-07db3a9b55f8 github.com/pkg/errors v0.9.1 ) @@ -24,7 +25,6 @@ require ( github.com/cloudwego/frugal v0.1.7 // indirect github.com/cloudwego/localsession v0.0.2 // indirect github.com/cloudwego/netpoll v0.4.1 // indirect - github.com/cloudwego/thriftgo v0.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dubbogo/gost v1.14.0 // indirect github.com/fatih/structtag v1.2.0 // indirect diff --git a/tests/kitex/go.sum b/tests/kitex/go.sum index 9e54beb9..35ccb3e1 100644 --- a/tests/kitex/go.sum +++ b/tests/kitex/go.sum @@ -571,8 +571,8 @@ github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZT github.com/dubbogo/gost v1.11.19/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/gost v1.11.20/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/gost v1.12.6-0.20220824084206-300e27e9e524/go.mod h1:0YHTGJtjHiYlWtVEkZnyrvhr7rR+23GczNaJrgc2v38= -github.com/dubbogo/gost v1.13.1 h1:71EJIwV6ev0CxWqWPwcDcHhzEq1Q5pUmCkLcLCBaqvM= github.com/dubbogo/gost v1.13.1/go.mod h1:9HMXBv+WBMRWhF3SklpqDjkS/01AKWm2SrVdz/A0xJI= +github.com/dubbogo/gost v1.14.0 h1:yc5YfozvUBAChAox8H7CkmHb6/TvF6cKdqZNJNv2jdE= github.com/dubbogo/gost v1.14.0/go.mod h1:YP28JweR+hhJdikP3bZ3bVKUWWI313xX1rgLaEE0FvQ= github.com/dubbogo/grpc-go v1.42.5-triple/go.mod h1:F1T9hnUvYGW4JLK1QNriavpOkhusU677ovPzLkk6zHM= github.com/dubbogo/grpc-go v1.42.6-triple/go.mod h1:F1T9hnUvYGW4JLK1QNriavpOkhusU677ovPzLkk6zHM= @@ -759,9 +759,9 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -807,8 +807,8 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -958,8 +958,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -1156,6 +1156,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= @@ -1306,8 +1307,8 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= @@ -1471,7 +1472,6 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= @@ -1518,9 +1518,9 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1634,7 +1634,6 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2 h1:fqTvyMIIj+HRzMmnzr9NtpHP6uVpvB5fkHcgPDC4nu8= golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1642,6 +1641,7 @@ golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1665,11 +1665,11 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1756,7 +1756,6 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= @@ -1881,7 +1880,6 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384 h1:z+j74wi4yV+P7EtK9gPLGukOk7mFOy9wMQaC0wNb7eY= google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= @@ -1946,6 +1944,7 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -1989,11 +1988,11 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -2011,16 +2010,16 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/tests/kitex/handler.go b/tests/kitex/handler.go index 9593869e..fae9ec25 100644 --- a/tests/kitex/handler.go +++ b/tests/kitex/handler.go @@ -247,3 +247,147 @@ func (s *TestServiceImpl) EchoMultiString(ctx context.Context, baseReq string, l MapResp: mapReq, }, nil } + +// EchoBaseBool implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseBool(ctx context.Context, req bool) (resp bool, err error) { + return req, nil +} + +// EchoBaseByte implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseByte(ctx context.Context, req int8) (resp int8, err error) { + return req, nil +} + +// EchoBaseInt16 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt16(ctx context.Context, req int16) (resp int16, err error) { + return req, nil +} + +// EchoBaseInt32 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt32(ctx context.Context, req int32) (resp int32, err error) { + return req, nil +} + +// EchoBaseInt64 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt64(ctx context.Context, req int64) (resp int64, err error) { + return req, nil +} + +// EchoBaseDouble implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseDouble(ctx context.Context, req float64) (resp float64, err error) { + return req, nil +} + +// EchoBaseBoolList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseBoolList(ctx context.Context, req []bool) (resp []bool, err error) { + return req, nil +} + +// EchoBaseByteList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseByteList(ctx context.Context, req []int8) (resp []int8, err error) { + return req, nil +} + +// EchoBaseInt16List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt16List(ctx context.Context, req []int16) (resp []int16, err error) { + return req, nil +} + +// EchoBaseInt32List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt32List(ctx context.Context, req []int32) (resp []int32, err error) { + return req, nil +} + +// EchoBaseInt64List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt64List(ctx context.Context, req []int64) (resp []int64, err error) { + return req, nil +} + +// EchoBaseDoubleList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseDoubleList(ctx context.Context, req []float64) (resp []float64, err error) { + return req, nil +} + +// EchoBool2BoolBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool) (resp map[bool]bool, err error) { + return req, nil +} + +// EchoBool2ByteBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8) (resp map[bool]int8, err error) { + return req, nil +} + +// EchoBool2Int16BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16) (resp map[bool]int16, err error) { + return req, nil +} + +// EchoBool2Int32BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32) (resp map[bool]int32, err error) { + return req, nil +} + +// EchoBool2Int64BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64) (resp map[bool]int64, err error) { + return req, nil +} + +// EchoBool2DoubleBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64) (resp map[bool]float64, err error) { + return req, nil +} + +// EchoMultiBaseBool implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool) (resp *echo.EchoMultiBoolResponse, err error) { + return &echo.EchoMultiBoolResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseByte implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8) (resp *echo.EchoMultiByteResponse, err error) { + return &echo.EchoMultiByteResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt16 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16) (resp *echo.EchoMultiInt16Response, err error) { + return &echo.EchoMultiInt16Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt32 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32) (resp *echo.EchoMultiInt32Response, err error) { + return &echo.EchoMultiInt32Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt64 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64) (resp *echo.EchoMultiInt64Response, err error) { + return &echo.EchoMultiInt64Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseDouble implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64) (resp *echo.EchoMultiDoubleResponse, err error) { + return &echo.EchoMultiDoubleResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} diff --git a/tests/kitex/kitex_gen/echo/api-reflection.go b/tests/kitex/kitex_gen/echo/api-reflection.go new file mode 100644 index 00000000..04110e13 --- /dev/null +++ b/tests/kitex/kitex_gen/echo/api-reflection.go @@ -0,0 +1,180 @@ +// Code generated by thriftgo (0.3.2). DO NOT EDIT. + +package echo + +import ( + "reflect" + + "github.com/cloudwego/thriftgo/thrift_reflection" +) + +// IDL Name: api +// IDL Path: api.thrift + +var file_api_thrift_go_types = []interface{}{ + (*EchoRequest)(nil), // Struct 0: echo.EchoRequest + (*EchoResponse)(nil), // Struct 1: echo.EchoResponse + (*EchoMultiBoolResponse)(nil), // Struct 2: echo.EchoMultiBoolResponse + (*EchoMultiByteResponse)(nil), // Struct 3: echo.EchoMultiByteResponse + (*EchoMultiInt16Response)(nil), // Struct 4: echo.EchoMultiInt16Response + (*EchoMultiInt32Response)(nil), // Struct 5: echo.EchoMultiInt32Response + (*EchoMultiInt64Response)(nil), // Struct 6: echo.EchoMultiInt64Response + (*EchoMultiDoubleResponse)(nil), // Struct 7: echo.EchoMultiDoubleResponse + (*EchoMultiStringResponse)(nil), // Struct 8: echo.EchoMultiStringResponse +} +var file_api_thrift *thrift_reflection.FileDescriptor +var file_idl_api_rawDesc = []byte{ + 0x1f, 0x8b, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xec, 0x5c, 0xdf, 0x6f, 0xe2, 0xc6, + 0x13, 0xdf, 0x6f, 0x20, 0x81, 0x84, 0x70, 0x5c, 0xee, 0x7b, 0x49, 0x1e, 0xaa, 0xaa, 0x54, 0x7d, + 0xe8, 0xb, 0x82, 0x6, 0x10, 0xef, 0xbd, 0x5e, 0xa5, 0xb6, 0x6a, 0xaa, 0xea, 0xee, 0xfa, 0x54, + 0xf5, 0x61, 0x21, 0x7b, 0xe0, 0x96, 0xd8, 0x9c, 0x77, 0x89, 0xca, 0x7f, 0x5f, 0xad, 0xd7, 0x3f, + 0x30, 0x17, 0xaf, 0x7f, 0xec, 0xce, 0xda, 0x20, 0x5e, 0x8e, 0x53, 0xbc, 0xcc, 0xce, 0x7c, 0xe6, + 0x63, 0xef, 0xcc, 0x78, 0x86, 0x16, 0xfa, 0x1f, 0x42, 0xe8, 0x2, 0xaf, 0xac, 0x3e, 0x5b, 0xb8, + 0xd6, 0x47, 0xd6, 0x46, 0x27, 0xad, 0x16, 0x42, 0x8, 0xb5, 0x51, 0xcd, 0xfb, 0xf, 0xbf, 0x7e, + 0x32, 0x77, 0x10, 0x42, 0x75, 0x32, 0x5b, 0x38, 0x1d, 0x54, 0xbf, 0xe4, 0x7f, 0xfd, 0xec, 0x8b, + 0x2d, 0x74, 0x82, 0x10, 0x6a, 0x7d, 0x20, 0x94, 0xbd, 0x27, 0xee, 0x93, 0x35, 0x23, 0x1d, 0x54, + 0xe3, 0x4b, 0xbf, 0x4f, 0x58, 0xda, 0xf8, 0x71, 0xb6, 0x70, 0x7e, 0xb6, 0xd9, 0x25, 0xaa, 0x25, + 0xac, 0xa8, 0x59, 0xa3, 0x21, 0x4a, 0xd9, 0xb0, 0xe6, 0x92, 0x4f, 0x29, 0x12, 0x5a, 0xa8, 0xce, + 0xb7, 0x7b, 0x4b, 0x3e, 0xe2, 0xf5, 0x92, 0x35, 0xd1, 0x29, 0x17, 0xd7, 0x46, 0x8d, 0x56, 0x87, + 0xdb, 0xd9, 0x42, 0x4d, 0x24, 0xec, 0x3d, 0xd, 0xfe, 0x70, 0xc6, 0x3f, 0x3a, 0xa8, 0xc1, 0xf7, + 0x45, 0x27, 0xfc, 0x7a, 0x82, 0xf8, 0x26, 0x37, 0xe1, 0x8d, 0xe3, 0x2c, 0x93, 0x35, 0xa8, 0x4f, + 0x1d, 0x67, 0xa9, 0x66, 0x84, 0x10, 0x51, 0xc8, 0x8a, 0xf6, 0x60, 0xd0, 0x9d, 0x62, 0x4a, 0xba, + 0x6c, 0xb3, 0x22, 0x34, 0xbb, 0x49, 0x1b, 0x46, 0x64, 0xfa, 0x6c, 0x18, 0x51, 0x35, 0x89, 0x8b, + 0x80, 0x73, 0xcc, 0xb9, 0xcf, 0xad, 0xbb, 0x89, 0x8c, 0x1b, 0x77, 0x13, 0x55, 0x76, 0xdd, 0x4d, + 0xc, 0x18, 0x31, 0x1a, 0xee, 0xf1, 0x2d, 0x12, 0x18, 0x31, 0x19, 0xcb, 0x54, 0x98, 0x8c, 0x55, + 0x8d, 0x98, 0x8c, 0x1, 0x8d, 0xb8, 0xe0, 0x46, 0xbc, 0x75, 0xd6, 0xd3, 0xa5, 0xe4, 0xb6, 0x38, + 0x7b, 0xf0, 0x16, 0xa8, 0x19, 0x12, 0x8, 0x1, 0xb6, 0xe5, 0x3d, 0x73, 0x2d, 0x7b, 0x2e, 0x51, + 0x83, 0x7a, 0xb, 0x14, 0x6d, 0xf1, 0x85, 0x0, 0xdb, 0xf2, 0xc6, 0xb2, 0xb1, 0xbb, 0x91, 0xa8, + 0x31, 0xf5, 0x16, 0x28, 0xda, 0xe2, 0xb, 0x29, 0x64, 0xcb, 0xcb, 0xc1, 0xa0, 0x4b, 0x57, 0x64, + 0x66, 0xe1, 0x65, 0xf6, 0x7, 0x71, 0x9d, 0xdb, 0x96, 0xac, 0xd0, 0x25, 0xbf, 0xfc, 0x8e, 0xd0, + 0x95, 0x63, 0x53, 0x45, 0xce, 0xb5, 0x84, 0xa8, 0x4f, 0x6b, 0x42, 0x59, 0x31, 0x3, 0x2f, 0xb8, + 0x81, 0xcc, 0x5d, 0xcf, 0x58, 0x26, 0xd3, 0x2e, 0x83, 0x63, 0xf3, 0x57, 0x8b, 0x4a, 0x8e, 0xff, + 0xfa, 0xd2, 0xbb, 0x5c, 0x97, 0x1e, 0x8b, 0x8a, 0xe7, 0x50, 0xa6, 0x2d, 0xa, 0x61, 0x72, 0x35, + 0x18, 0x74, 0x67, 0x8e, 0xcd, 0xb0, 0x65, 0x13, 0xb7, 0xcb, 0xf7, 0xc9, 0xe, 0xcd, 0x86, 0x11, + 0x45, 0x68, 0xf8, 0xf1, 0xa, 0xc, 0x8d, 0xb7, 0x5, 0xdc, 0xbd, 0xdd, 0xe, 0x8f, 0x70, 0x25, + 0x28, 0xbc, 0x33, 0x1a, 0x14, 0x9, 0xb1, 0x3, 0x3c, 0x10, 0xa3, 0xa1, 0x22, 0x10, 0xa3, 0x21, + 0x34, 0x10, 0x7c, 0x7, 0x78, 0x20, 0x26, 0x63, 0x45, 0x20, 0x26, 0x63, 0x68, 0x20, 0xf8, 0xe, + 0x70, 0x40, 0xbc, 0x88, 0xc2, 0x11, 0x25, 0x24, 0x82, 0x60, 0x3, 0x14, 0x8c, 0x70, 0x13, 0x60, + 0x3c, 0x44, 0x48, 0xa3, 0x86, 0x87, 0x1f, 0xb0, 0xc0, 0xe2, 0x11, 0x6c, 0x2, 0x8c, 0x87, 0x8, + 0x8b, 0xd4, 0xf0, 0xf0, 0x83, 0x1e, 0x58, 0x3c, 0x82, 0x4d, 0xe0, 0xf0, 0x78, 0x19, 0xc4, 0x1b, + 0x43, 0xfe, 0xcf, 0x3d, 0x5e, 0x49, 0x12, 0x89, 0x47, 0xd9, 0x55, 0x11, 0xf, 0xc0, 0x86, 0x24, + 0x5a, 0x34, 0x28, 0x1c, 0xa6, 0x46, 0x11, 0xcb, 0x23, 0x5e, 0xe5, 0xc4, 0x76, 0xc3, 0x8, 0x28, + 0xb6, 0xea, 0x31, 0x8d, 0x16, 0xd, 0xe0, 0x78, 0x7a, 0x15, 0x62, 0xe9, 0xc5, 0x3d, 0x80, 0x60, + 0x6a, 0x88, 0x8a, 0x74, 0x28, 0x60, 0x8, 0xca, 0xd1, 0x10, 0x14, 0x4a, 0xe5, 0xb8, 0x4a, 0x87, + 0x2, 0x86, 0xa0, 0x9c, 0x8c, 0x41, 0xa1, 0x54, 0x8e, 0xcc, 0x74, 0x28, 0x0, 0x7, 0xe5, 0xab, + 0x10, 0x4a, 0x11, 0xbd, 0x1, 0x62, 0xa9, 0x27, 0xb6, 0xd3, 0xa4, 0x83, 0x9, 0x44, 0x45, 0xfc, + 0x7, 0x89, 0xa8, 0x96, 0xe8, 0x50, 0x93, 0xe, 0x26, 0x10, 0x15, 0x11, 0x24, 0x24, 0xa2, 0x5a, + 0xe2, 0x4b, 0x4d, 0x3a, 0xc0, 0x21, 0xfa, 0x3a, 0x16, 0x7e, 0xf2, 0x88, 0x1c, 0x32, 0x4c, 0xca, + 0x54, 0xd1, 0x2a, 0x35, 0x8c, 0xca, 0xa6, 0xa1, 0x11, 0x7f, 0xf8, 0x85, 0xb6, 0x32, 0xfd, 0xe1, + 0xc5, 0x94, 0x95, 0xf6, 0x87, 0xd0, 0x10, 0xce, 0x1f, 0xd7, 0xf1, 0xb0, 0xb7, 0x5c, 0x87, 0x88, + 0xc0, 0xb4, 0xc2, 0xfe, 0xf0, 0x15, 0x34, 0xe4, 0xe, 0x51, 0x74, 0x2c, 0xd3, 0x1d, 0x3c, 0xb8, + 0xad, 0xb4, 0x3b, 0x3c, 0x5, 0xd, 0xb9, 0x43, 0x94, 0x3e, 0xcb, 0x74, 0x7, 0xf, 0x90, 0x2b, + 0xed, 0xe, 0x4f, 0x41, 0x38, 0x77, 0xdc, 0xec, 0x84, 0xf0, 0xe5, 0xfa, 0x23, 0x8c, 0xb0, 0x2b, + 0xec, 0x92, 0x48, 0x47, 0x13, 0x5e, 0x89, 0xca, 0xc0, 0x25, 0x7a, 0x25, 0x88, 0xd2, 0xab, 0xec, + 0x95, 0x50, 0x47, 0x13, 0x5e, 0x89, 0x8a, 0xd1, 0x25, 0x7a, 0x25, 0x88, 0xf4, 0xab, 0xec, 0x95, + 0x50, 0x47, 0xe0, 0xd7, 0x68, 0xf7, 0xeb, 0x25, 0xb3, 0xe4, 0x9d, 0x6b, 0xd7, 0xb1, 0x75, 0xbb, + 0xad, 0x6, 0x49, 0xdf, 0x6a, 0x4c, 0x31, 0x25, 0xef, 0x74, 0xb5, 0xb3, 0x25, 0x6d, 0xc2, 0x51, + 0x94, 0x6f, 0x52, 0xf8, 0xc5, 0xfe, 0x49, 0x56, 0x25, 0xce, 0x1e, 0xf1, 0x4a, 0xaa, 0x3, 0x58, + 0x25, 0xbf, 0xa6, 0x9b, 0x7, 0xd2, 0x76, 0xbf, 0xeb, 0xd8, 0x3a, 0x9d, 0x3c, 0xc8, 0xde, 0x3, + 0x8, 0xc7, 0x83, 0xc4, 0x92, 0xbe, 0x39, 0x1e, 0x70, 0x15, 0xa, 0xa9, 0xa8, 0x87, 0x7, 0x2f, + 0x42, 0xff, 0xa6, 0x34, 0x4c, 0xde, 0xc4, 0x17, 0xea, 0x63, 0x42, 0x8e, 0x3e, 0x4a, 0x28, 0x22, + 0x24, 0xbf, 0x8f, 0x30, 0xc5, 0x3, 0x4f, 0x83, 0x22, 0xa, 0x2, 0xb0, 0x40, 0xd6, 0x71, 0x7a, + 0x13, 0x5f, 0xa8, 0x93, 0x5, 0x99, 0x1b, 0x51, 0xe1, 0x58, 0x90, 0xf4, 0x2a, 0xc5, 0x1c, 0xb, + 0x46, 0xc3, 0x42, 0xef, 0x7a, 0x0, 0x58, 0x20, 0x6b, 0xd9, 0xbd, 0x89, 0x2f, 0xd4, 0xc9, 0x82, + 0xcc, 0x9d, 0xbc, 0x70, 0x2c, 0x48, 0x7a, 0xb, 0x64, 0x8e, 0x5, 0x93, 0x71, 0xa1, 0xd7, 0x54, + 0x7a, 0x58, 0xd0, 0x9, 0x9d, 0x9b, 0xd6, 0xf3, 0x7c, 0xbb, 0xb3, 0x52, 0x1f, 0xf, 0xf2, 0x35, + 0x42, 0x43, 0x51, 0x41, 0xfa, 0x6, 0xcb, 0x14, 0x1b, 0x2, 0x25, 0xa, 0xaa, 0xa9, 0x9b, 0x13, + 0x69, 0xbd, 0xe3, 0xb7, 0x3b, 0x2b, 0x35, 0x72, 0x22, 0x57, 0x43, 0x39, 0x18, 0x27, 0x64, 0xef, + 0xe0, 0x8c, 0x71, 0xc2, 0x57, 0xa2, 0xa0, 0x9a, 0x7a, 0x38, 0x21, 0x9a, 0x95, 0x31, 0x25, 0x95, + 0x1c, 0x81, 0xe2, 0x82, 0x5e, 0x2e, 0x8, 0xa5, 0x16, 0xb6, 0xfb, 0xd8, 0x9d, 0xd3, 0xf, 0x9b, + 0x15, 0x9, 0x26, 0xda, 0x1a, 0x5c, 0x20, 0xc1, 0xb6, 0xb0, 0xf6, 0xf5, 0x60, 0xd0, 0x7d, 0x24, + 0x6c, 0xe1, 0x3c, 0x74, 0xb1, 0x6d, 0x3b, 0xc, 0x33, 0xcb, 0xb1, 0xf3, 0x21, 0x50, 0xc5, 0x89, + 0x29, 0x29, 0x2, 0x9e, 0xc0, 0xbc, 0xe9, 0x22, 0x37, 0xb5, 0x8a, 0x63, 0x55, 0x52, 0x4b, 0x4f, + 0xe9, 0xc2, 0x71, 0x59, 0x41, 0x53, 0x2b, 0x37, 0x7c, 0x25, 0x35, 0xb5, 0x66, 0xd9, 0x45, 0xd, + 0xad, 0xdc, 0x80, 0x96, 0x9c, 0xbd, 0x4b, 0xc7, 0x9e, 0xe7, 0x6e, 0x89, 0xc5, 0x94, 0x54, 0x78, + 0x8a, 0x4b, 0x6a, 0xb0, 0x2f, 0x32, 0x77, 0xd7, 0xab, 0xff, 0x74, 0x3e, 0xc8, 0x49, 0x1b, 0x29, + 0x60, 0xe7, 0xfe, 0x13, 0xfe, 0xcf, 0xbf, 0xa, 0x61, 0x76, 0xa8, 0x23, 0x38, 0x72, 0x92, 0x71, + 0x89, 0xb9, 0x0, 0xbb, 0x8a, 0x9d, 0xa, 0x7, 0x38, 0xa9, 0x23, 0x8f, 0x22, 0xbc, 0x93, 0xa5, + 0x30, 0x60, 0x7, 0x39, 0xd1, 0x23, 0x3f, 0x8a, 0x2d, 0xbb, 0x38, 0x5c, 0x7, 0x39, 0xf7, 0x23, + 0xbf, 0x1f, 0xf9, 0x29, 0x97, 0xb, 0xaf, 0x57, 0xf1, 0x73, 0xee, 0x60, 0xc7, 0x83, 0xa4, 0xb0, + 0x35, 0x85, 0xcc, 0x5c, 0xc0, 0xc5, 0x9b, 0xf4, 0x38, 0x82, 0xc7, 0x39, 0x91, 0x5c, 0xa0, 0x5f, + 0xfd, 0x8d, 0x9f, 0x70, 0x7f, 0xcd, 0xac, 0x65, 0xff, 0x27, 0x4c, 0x17, 0xf7, 0x78, 0x55, 0xb8, + 0x25, 0xf, 0x1c, 0xfd, 0xbd, 0x9c, 0x24, 0x81, 0x43, 0x7f, 0xa7, 0x1, 0xf, 0x18, 0xfe, 0xbd, + 0x9c, 0x3d, 0x31, 0x4, 0xfe, 0x68, 0x8, 0xe, 0xfe, 0x1e, 0x4e, 0xab, 0x18, 0x2, 0x7f, 0x32, + 0x6, 0x7, 0x7f, 0xf, 0xe7, 0x5b, 0xe0, 0xc0, 0xdf, 0x6d, 0xa5, 0x3, 0x46, 0x7f, 0x8f, 0x27, + 0x62, 0xe0, 0x7c, 0x70, 0x15, 0x35, 0x77, 0xa4, 0xd6, 0x71, 0x8f, 0xd, 0x41, 0xfb, 0xd7, 0x10, + 0x24, 0x65, 0xce, 0x37, 0x7e, 0x89, 0xa4, 0x17, 0x96, 0x4a, 0x7a, 0x1a, 0xb9, 0x74, 0x6c, 0x2a, + 0x3a, 0xb0, 0xa6, 0x22, 0x29, 0x97, 0xbe, 0xe4, 0x12, 0x7b, 0xa2, 0x7e, 0xa4, 0xc4, 0xa2, 0x57, + 0x31, 0x16, 0x1d, 0x5b, 0x92, 0xe, 0xab, 0x25, 0x49, 0xca, 0xa1, 0xaf, 0xbc, 0x72, 0x5a, 0xcf, + 0x2f, 0xaa, 0xe9, 0x65, 0xd1, 0xb1, 0xa5, 0xe9, 0x80, 0x5a, 0x9a, 0xa4, 0x2c, 0xfa, 0xc2, 0xb2, + 0x59, 0xcf, 0xab, 0x33, 0xea, 0x65, 0xd0, 0xb1, 0x1d, 0xea, 0x80, 0xda, 0xa1, 0xe4, 0x67, 0xd9, + 0xd2, 0xb1, 0xe7, 0x3d, 0x51, 0x7b, 0x55, 0xe2, 0xd0, 0xff, 0x63, 0x1c, 0x3a, 0x36, 0x53, 0x1d, + 0x72, 0x33, 0x95, 0x94, 0x51, 0x5f, 0xb, 0x99, 0xbd, 0xa0, 0x30, 0x9d, 0x8d, 0x55, 0x6d, 0x54, + 0xf, 0x45, 0xb7, 0x7f, 0xc1, 0x4f, 0xf8, 0x87, 0x25, 0xa6, 0xf4, 0x37, 0xfc, 0x18, 0xca, 0xfd, + 0xd6, 0x71, 0xe7, 0x7d, 0xbc, 0xc2, 0xb3, 0x5, 0xe9, 0x3f, 0xac, 0xa7, 0x53, 0xa7, 0xcf, 0x8, + 0x65, 0xb4, 0xcf, 0x6d, 0xfa, 0x83, 0x12, 0xf7, 0x77, 0xd7, 0x79, 0xb2, 0x1e, 0x88, 0xdb, 0xf2, + 0x94, 0xe7, 0xe2, 0x4f, 0xb9, 0xf8, 0xf3, 0x4, 0xd3, 0xb7, 0x7f, 0x9, 0xd2, 0xff, 0xf5, 0xe6, + 0xa4, 0x2c, 0xf9, 0xd4, 0xca, 0xd0, 0x1b, 0x21, 0x10, 0x6c, 0x72, 0x89, 0x96, 0x4b, 0x1e, 0x92, + 0xd3, 0xdc, 0x34, 0x3b, 0x6f, 0xfe, 0xb1, 0x18, 0xf9, 0xb7, 0x4f, 0x66, 0xb, 0xa7, 0xbf, 0xa5, + 0x63, 0x60, 0x56, 0x82, 0xe, 0xb1, 0xdf, 0xc8, 0xac, 0x94, 0x3d, 0xb7, 0x9f, 0xd9, 0x23, 0x94, + 0x4c, 0x31, 0xe8, 0xf9, 0xc, 0xdc, 0xb7, 0x2c, 0x49, 0xf3, 0xa6, 0x78, 0x3c, 0xd0, 0xd4, 0xd4, + 0x33, 0xa3, 0x75, 0x49, 0xdb, 0x88, 0xc7, 0x83, 0x74, 0x9b, 0x1c, 0x39, 0xf8, 0x8e, 0x1a, 0x99, + 0x1f, 0xf, 0xd, 0xef, 0xf1, 0x20, 0xd3, 0x42, 0x63, 0x16, 0xbe, 0xa3, 0xe4, 0x73, 0xf, 0x87, + 0x34, 0x26, 0x7c, 0x27, 0xb9, 0x83, 0x9f, 0xf5, 0x76, 0x76, 0x8a, 0x6c, 0x25, 0xd6, 0x3a, 0x28, + 0x12, 0x25, 0xd6, 0x65, 0x52, 0x64, 0x2b, 0x6f, 0x2d, 0x8f, 0x22, 0x39, 0x92, 0x6b, 0x63, 0x14, + 0xd9, 0xf2, 0x76, 0xa, 0x45, 0x12, 0x92, 0x66, 0x75, 0x8e, 0x6c, 0x25, 0xcd, 0xe5, 0x51, 0x64, + 0x3b, 0x2b, 0x2d, 0x8b, 0x21, 0x39, 0x12, 0x67, 0xd, 0xfc, 0xb8, 0xcb, 0xc2, 0x8f, 0x98, 0xab, + 0xf3, 0x10, 0x24, 0xca, 0x87, 0x75, 0x10, 0x24, 0xfb, 0x21, 0xa, 0x48, 0x90, 0x28, 0xe1, 0x2c, + 0x8f, 0x20, 0x99, 0x73, 0x62, 0x83, 0x4, 0x89, 0x5c, 0x9d, 0x87, 0x20, 0x51, 0xba, 0xab, 0x83, + 0x20, 0x61, 0xba, 0x5b, 0x26, 0x41, 0xa2, 0x7c, 0xb2, 0x3c, 0x82, 0x64, 0x4e, 0x79, 0xd, 0x12, + 0x24, 0x72, 0x75, 0xa, 0x41, 0x92, 0x52, 0x59, 0x75, 0x86, 0xc4, 0x53, 0xd9, 0xf2, 0x48, 0xb2, + 0x93, 0x25, 0x96, 0xc5, 0x93, 0xdc, 0xe9, 0xac, 0x6, 0xb6, 0xc, 0xb3, 0xb0, 0x25, 0xee, 0xf7, + 0xcc, 0x74, 0x89, 0x8f, 0xc, 0x69, 0xa0, 0x4b, 0x6c, 0x64, 0xa8, 0x44, 0xba, 0xc4, 0xa7, 0x71, + 0x4a, 0xa3, 0x4b, 0xde, 0xb1, 0x21, 0x53, 0x74, 0x89, 0xfb, 0x3d, 0x2a, 0x57, 0x9c, 0x5d, 0x6e, + 0x57, 0x45, 0x3a, 0xa8, 0xe9, 0x7f, 0x9e, 0xfb, 0x9f, 0x17, 0xde, 0x27, 0xfa, 0x2f, 0x0, 0x0, + 0xff, 0xff, 0x6e, 0xf3, 0x2c, 0xfd, 0xc7, 0x6a, 0x0, 0x0, +} + +func init() { + if file_api_thrift != nil { + return + } + type x struct{} + builder := &thrift_reflection.FileDescriptorBuilder{ + Bytes: file_idl_api_rawDesc, + GoTypes: file_api_thrift_go_types, + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + } + file_api_thrift = thrift_reflection.BuildFileDescriptor(builder) +} + +func GetFileDescriptorForApi() *thrift_reflection.FileDescriptor { + return file_api_thrift +} +func (p *EchoRequest) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoRequest") +} +func (p *EchoResponse) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoResponse") +} +func (p *EchoMultiBoolResponse) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiBoolResponse") +} +func (p *EchoMultiByteResponse) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiByteResponse") +} +func (p *EchoMultiInt16Response) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiInt16Response") +} +func (p *EchoMultiInt32Response) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiInt32Response") +} +func (p *EchoMultiInt64Response) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiInt64Response") +} +func (p *EchoMultiDoubleResponse) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiDoubleResponse") +} +func (p *EchoMultiStringResponse) GetDescriptor() *thrift_reflection.StructDescriptor { + return file_api_thrift.GetStructDescriptor("EchoMultiStringResponse") +} diff --git a/tests/kitex/kitex_gen/echo/api.go b/tests/kitex/kitex_gen/echo/api.go index 345ba372..215874d1 100644 --- a/tests/kitex/kitex_gen/echo/api.go +++ b/tests/kitex/kitex_gen/echo/api.go @@ -435,4 +435,52 @@ type TestService interface { EchoMultiDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64) (r *EchoMultiDoubleResponse, err error) EchoMultiString(ctx context.Context, baseReq string, listReq []string, mapReq map[string]string) (r *EchoMultiStringResponse, err error) + + EchoBaseBool(ctx context.Context, req bool) (r bool, err error) + + EchoBaseByte(ctx context.Context, req int8) (r int8, err error) + + EchoBaseInt16(ctx context.Context, req int16) (r int16, err error) + + EchoBaseInt32(ctx context.Context, req int32) (r int32, err error) + + EchoBaseInt64(ctx context.Context, req int64) (r int64, err error) + + EchoBaseDouble(ctx context.Context, req float64) (r float64, err error) + + EchoBaseBoolList(ctx context.Context, req []bool) (r []bool, err error) + + EchoBaseByteList(ctx context.Context, req []int8) (r []int8, err error) + + EchoBaseInt16List(ctx context.Context, req []int16) (r []int16, err error) + + EchoBaseInt32List(ctx context.Context, req []int32) (r []int32, err error) + + EchoBaseInt64List(ctx context.Context, req []int64) (r []int64, err error) + + EchoBaseDoubleList(ctx context.Context, req []float64) (r []float64, err error) + + EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool) (r map[bool]bool, err error) + + EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8) (r map[bool]int8, err error) + + EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16) (r map[bool]int16, err error) + + EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32) (r map[bool]int32, err error) + + EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64) (r map[bool]int64, err error) + + EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64) (r map[bool]float64, err error) + + EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool) (r *EchoMultiBoolResponse, err error) + + EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8) (r *EchoMultiByteResponse, err error) + + EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16) (r *EchoMultiInt16Response, err error) + + EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32) (r *EchoMultiInt32Response, err error) + + EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64) (r *EchoMultiInt64Response, err error) + + EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64) (r *EchoMultiDoubleResponse, err error) } diff --git a/tests/kitex/kitex_gen/echo/hessian2-register-api.go b/tests/kitex/kitex_gen/echo/hessian2-register-api.go index 44194d9d..5bbb6aa1 100644 --- a/tests/kitex/kitex_gen/echo/hessian2-register-api.go +++ b/tests/kitex/kitex_gen/echo/hessian2-register-api.go @@ -2914,3 +2914,1467 @@ func (p *TestServiceEchoMultiStringResult) Decode(d codec.Decoder) error { return nil } + +func (p *TestServiceEchoBaseBoolArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseBoolArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseBoolResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseBoolResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseByteArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseByteArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseByteResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseByteResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt16Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt16Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt16Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt16Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt32Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt32Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt32Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt32Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt64Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt64Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt64Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt64Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseBoolListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseBoolListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseBoolListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseBoolListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseByteListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseByteListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseByteListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseByteListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt16ListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt16ListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt16ListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt16ListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt32ListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt32ListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt32ListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt32ListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt64ListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt64ListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseInt64ListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseInt64ListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleListArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleListArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleListResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBaseDoubleListResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2BoolBaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2BoolBaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2BoolBaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2BoolBaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2ByteBaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2ByteBaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2ByteBaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2ByteBaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int16BaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int16BaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int16BaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int16BaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int32BaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int32BaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int32BaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int32BaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int64BaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int64BaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2Int64BaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2Int64BaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2DoubleBaseMapArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Req) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2DoubleBaseMapArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Req) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoBool2DoubleBaseMapResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoBool2DoubleBaseMapResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseBoolArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseBoolArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseBoolResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseBoolResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseByteArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseByteArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseByteResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseByteResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt16Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt16Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt16Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt16Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt32Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt32Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt32Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt32Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt64Args) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt64Args) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt64Result) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseInt64Result) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.BaseReq) + if err != nil { + return err + } + + err = e.Encode(p.ListReq) + if err != nil { + return err + } + + err = e.Encode(p.MapReq) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.BaseReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.ListReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.MapReq) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} + +func (p *TestServiceEchoMultiBaseDoubleResult) Encode(e codec.Encoder) error { + var err error + err = e.Encode(p.Success) + if err != nil { + return err + } + + return nil +} + +func (p *TestServiceEchoMultiBaseDoubleResult) Decode(d codec.Decoder) error { + var ( + err error + v interface{} + ) + v, err = d.Decode() + if err != nil { + return err + } + err = hessian2.ReflectResponse(v, &p.Success) + if err != nil { + return errors.Wrap(err, fmt.Sprintf("invalid data type: %T", v)) + } + + return nil +} diff --git a/tests/kitex/kitex_gen/echo/k-api.go b/tests/kitex/kitex_gen/echo/k-api.go index 3d4225dc..4de511ef 100644 --- a/tests/kitex/kitex_gen/echo/k-api.go +++ b/tests/kitex/kitex_gen/echo/k-api.go @@ -1,4 +1,4 @@ -// Code generated by Kitex v0.7.2. DO NOT EDIT. +// Code generated by Kitex v0.7.3. DO NOT EDIT. package echo @@ -2887,3 +2887,1707 @@ func (p *TestServiceEchoMultiStringResult) String() string { func (p *TestServiceEchoMultiStringResult) GetResult() interface{} { return p.Success } + +type TestServiceEchoBaseBoolArgs struct { + Req bool `thrift:"req,1" frugal:"1,default,bool" json:"req"` +} + +func NewTestServiceEchoBaseBoolArgs() *TestServiceEchoBaseBoolArgs { + return &TestServiceEchoBaseBoolArgs{} +} + +func (p *TestServiceEchoBaseBoolArgs) InitDefault() { + *p = TestServiceEchoBaseBoolArgs{} +} + +func (p *TestServiceEchoBaseBoolArgs) GetReq() (v bool) { + return p.Req +} +func (p *TestServiceEchoBaseBoolArgs) SetReq(val bool) { + p.Req = val +} + +func (p *TestServiceEchoBaseBoolArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseBoolArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseBoolArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseBoolResult struct { + Success *bool `thrift:"success,0,optional" frugal:"0,optional,bool" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseBoolResult() *TestServiceEchoBaseBoolResult { + return &TestServiceEchoBaseBoolResult{} +} + +func (p *TestServiceEchoBaseBoolResult) InitDefault() { + *p = TestServiceEchoBaseBoolResult{} +} + +var TestServiceEchoBaseBoolResult_Success_DEFAULT bool + +func (p *TestServiceEchoBaseBoolResult) GetSuccess() (v bool) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseBoolResult_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseBoolResult) SetSuccess(x interface{}) { + p.Success = x.(*bool) +} + +func (p *TestServiceEchoBaseBoolResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseBoolResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseBoolResult(%+v)", *p) +} +func (p *TestServiceEchoBaseBoolResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseByteArgs struct { + Req int8 `thrift:"req,1" frugal:"1,default,byte" json:"req"` +} + +func NewTestServiceEchoBaseByteArgs() *TestServiceEchoBaseByteArgs { + return &TestServiceEchoBaseByteArgs{} +} + +func (p *TestServiceEchoBaseByteArgs) InitDefault() { + *p = TestServiceEchoBaseByteArgs{} +} + +func (p *TestServiceEchoBaseByteArgs) GetReq() (v int8) { + return p.Req +} +func (p *TestServiceEchoBaseByteArgs) SetReq(val int8) { + p.Req = val +} + +func (p *TestServiceEchoBaseByteArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseByteArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseByteArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseByteResult struct { + Success *int8 `thrift:"success,0,optional" frugal:"0,optional,byte" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseByteResult() *TestServiceEchoBaseByteResult { + return &TestServiceEchoBaseByteResult{} +} + +func (p *TestServiceEchoBaseByteResult) InitDefault() { + *p = TestServiceEchoBaseByteResult{} +} + +var TestServiceEchoBaseByteResult_Success_DEFAULT int8 + +func (p *TestServiceEchoBaseByteResult) GetSuccess() (v int8) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseByteResult_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseByteResult) SetSuccess(x interface{}) { + p.Success = x.(*int8) +} + +func (p *TestServiceEchoBaseByteResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseByteResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseByteResult(%+v)", *p) +} +func (p *TestServiceEchoBaseByteResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt16Args struct { + Req int16 `thrift:"req,1" frugal:"1,default,i16" json:"req"` +} + +func NewTestServiceEchoBaseInt16Args() *TestServiceEchoBaseInt16Args { + return &TestServiceEchoBaseInt16Args{} +} + +func (p *TestServiceEchoBaseInt16Args) InitDefault() { + *p = TestServiceEchoBaseInt16Args{} +} + +func (p *TestServiceEchoBaseInt16Args) GetReq() (v int16) { + return p.Req +} +func (p *TestServiceEchoBaseInt16Args) SetReq(val int16) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt16Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt16Args(%+v)", *p) +} +func (p *TestServiceEchoBaseInt16Args) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt16Result struct { + Success *int16 `thrift:"success,0,optional" frugal:"0,optional,i16" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt16Result() *TestServiceEchoBaseInt16Result { + return &TestServiceEchoBaseInt16Result{} +} + +func (p *TestServiceEchoBaseInt16Result) InitDefault() { + *p = TestServiceEchoBaseInt16Result{} +} + +var TestServiceEchoBaseInt16Result_Success_DEFAULT int16 + +func (p *TestServiceEchoBaseInt16Result) GetSuccess() (v int16) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt16Result_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseInt16Result) SetSuccess(x interface{}) { + p.Success = x.(*int16) +} + +func (p *TestServiceEchoBaseInt16Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt16Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt16Result(%+v)", *p) +} +func (p *TestServiceEchoBaseInt16Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt32Args struct { + Req int32 `thrift:"req,1" frugal:"1,default,i32" json:"req"` +} + +func NewTestServiceEchoBaseInt32Args() *TestServiceEchoBaseInt32Args { + return &TestServiceEchoBaseInt32Args{} +} + +func (p *TestServiceEchoBaseInt32Args) InitDefault() { + *p = TestServiceEchoBaseInt32Args{} +} + +func (p *TestServiceEchoBaseInt32Args) GetReq() (v int32) { + return p.Req +} +func (p *TestServiceEchoBaseInt32Args) SetReq(val int32) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt32Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt32Args(%+v)", *p) +} +func (p *TestServiceEchoBaseInt32Args) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt32Result struct { + Success *int32 `thrift:"success,0,optional" frugal:"0,optional,i32" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt32Result() *TestServiceEchoBaseInt32Result { + return &TestServiceEchoBaseInt32Result{} +} + +func (p *TestServiceEchoBaseInt32Result) InitDefault() { + *p = TestServiceEchoBaseInt32Result{} +} + +var TestServiceEchoBaseInt32Result_Success_DEFAULT int32 + +func (p *TestServiceEchoBaseInt32Result) GetSuccess() (v int32) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt32Result_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseInt32Result) SetSuccess(x interface{}) { + p.Success = x.(*int32) +} + +func (p *TestServiceEchoBaseInt32Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt32Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt32Result(%+v)", *p) +} +func (p *TestServiceEchoBaseInt32Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt64Args struct { + Req int64 `thrift:"req,1" frugal:"1,default,i64" json:"req"` +} + +func NewTestServiceEchoBaseInt64Args() *TestServiceEchoBaseInt64Args { + return &TestServiceEchoBaseInt64Args{} +} + +func (p *TestServiceEchoBaseInt64Args) InitDefault() { + *p = TestServiceEchoBaseInt64Args{} +} + +func (p *TestServiceEchoBaseInt64Args) GetReq() (v int64) { + return p.Req +} +func (p *TestServiceEchoBaseInt64Args) SetReq(val int64) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt64Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt64Args(%+v)", *p) +} +func (p *TestServiceEchoBaseInt64Args) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt64Result struct { + Success *int64 `thrift:"success,0,optional" frugal:"0,optional,i64" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt64Result() *TestServiceEchoBaseInt64Result { + return &TestServiceEchoBaseInt64Result{} +} + +func (p *TestServiceEchoBaseInt64Result) InitDefault() { + *p = TestServiceEchoBaseInt64Result{} +} + +var TestServiceEchoBaseInt64Result_Success_DEFAULT int64 + +func (p *TestServiceEchoBaseInt64Result) GetSuccess() (v int64) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt64Result_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseInt64Result) SetSuccess(x interface{}) { + p.Success = x.(*int64) +} + +func (p *TestServiceEchoBaseInt64Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt64Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt64Result(%+v)", *p) +} +func (p *TestServiceEchoBaseInt64Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseDoubleArgs struct { + Req float64 `thrift:"req,1" frugal:"1,default,double" json:"req"` +} + +func NewTestServiceEchoBaseDoubleArgs() *TestServiceEchoBaseDoubleArgs { + return &TestServiceEchoBaseDoubleArgs{} +} + +func (p *TestServiceEchoBaseDoubleArgs) InitDefault() { + *p = TestServiceEchoBaseDoubleArgs{} +} + +func (p *TestServiceEchoBaseDoubleArgs) GetReq() (v float64) { + return p.Req +} +func (p *TestServiceEchoBaseDoubleArgs) SetReq(val float64) { + p.Req = val +} + +func (p *TestServiceEchoBaseDoubleArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseDoubleArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseDoubleArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseDoubleResult struct { + Success *float64 `thrift:"success,0,optional" frugal:"0,optional,double" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseDoubleResult() *TestServiceEchoBaseDoubleResult { + return &TestServiceEchoBaseDoubleResult{} +} + +func (p *TestServiceEchoBaseDoubleResult) InitDefault() { + *p = TestServiceEchoBaseDoubleResult{} +} + +var TestServiceEchoBaseDoubleResult_Success_DEFAULT float64 + +func (p *TestServiceEchoBaseDoubleResult) GetSuccess() (v float64) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseDoubleResult_Success_DEFAULT + } + return *p.Success +} +func (p *TestServiceEchoBaseDoubleResult) SetSuccess(x interface{}) { + p.Success = x.(*float64) +} + +func (p *TestServiceEchoBaseDoubleResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseDoubleResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseDoubleResult(%+v)", *p) +} +func (p *TestServiceEchoBaseDoubleResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseBoolListArgs struct { + Req []bool `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseBoolListArgs() *TestServiceEchoBaseBoolListArgs { + return &TestServiceEchoBaseBoolListArgs{} +} + +func (p *TestServiceEchoBaseBoolListArgs) InitDefault() { + *p = TestServiceEchoBaseBoolListArgs{} +} + +func (p *TestServiceEchoBaseBoolListArgs) GetReq() (v []bool) { + return p.Req +} +func (p *TestServiceEchoBaseBoolListArgs) SetReq(val []bool) { + p.Req = val +} + +func (p *TestServiceEchoBaseBoolListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseBoolListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseBoolListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseBoolListResult struct { + Success []bool `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseBoolListResult() *TestServiceEchoBaseBoolListResult { + return &TestServiceEchoBaseBoolListResult{} +} + +func (p *TestServiceEchoBaseBoolListResult) InitDefault() { + *p = TestServiceEchoBaseBoolListResult{} +} + +var TestServiceEchoBaseBoolListResult_Success_DEFAULT []bool + +func (p *TestServiceEchoBaseBoolListResult) GetSuccess() (v []bool) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseBoolListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseBoolListResult) SetSuccess(x interface{}) { + p.Success = x.([]bool) +} + +func (p *TestServiceEchoBaseBoolListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseBoolListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseBoolListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseBoolListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseByteListArgs struct { + Req []int8 `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseByteListArgs() *TestServiceEchoBaseByteListArgs { + return &TestServiceEchoBaseByteListArgs{} +} + +func (p *TestServiceEchoBaseByteListArgs) InitDefault() { + *p = TestServiceEchoBaseByteListArgs{} +} + +func (p *TestServiceEchoBaseByteListArgs) GetReq() (v []int8) { + return p.Req +} +func (p *TestServiceEchoBaseByteListArgs) SetReq(val []int8) { + p.Req = val +} + +func (p *TestServiceEchoBaseByteListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseByteListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseByteListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseByteListResult struct { + Success []int8 `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseByteListResult() *TestServiceEchoBaseByteListResult { + return &TestServiceEchoBaseByteListResult{} +} + +func (p *TestServiceEchoBaseByteListResult) InitDefault() { + *p = TestServiceEchoBaseByteListResult{} +} + +var TestServiceEchoBaseByteListResult_Success_DEFAULT []int8 + +func (p *TestServiceEchoBaseByteListResult) GetSuccess() (v []int8) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseByteListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseByteListResult) SetSuccess(x interface{}) { + p.Success = x.([]int8) +} + +func (p *TestServiceEchoBaseByteListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseByteListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseByteListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseByteListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt16ListArgs struct { + Req []int16 `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseInt16ListArgs() *TestServiceEchoBaseInt16ListArgs { + return &TestServiceEchoBaseInt16ListArgs{} +} + +func (p *TestServiceEchoBaseInt16ListArgs) InitDefault() { + *p = TestServiceEchoBaseInt16ListArgs{} +} + +func (p *TestServiceEchoBaseInt16ListArgs) GetReq() (v []int16) { + return p.Req +} +func (p *TestServiceEchoBaseInt16ListArgs) SetReq(val []int16) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt16ListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt16ListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseInt16ListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt16ListResult struct { + Success []int16 `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt16ListResult() *TestServiceEchoBaseInt16ListResult { + return &TestServiceEchoBaseInt16ListResult{} +} + +func (p *TestServiceEchoBaseInt16ListResult) InitDefault() { + *p = TestServiceEchoBaseInt16ListResult{} +} + +var TestServiceEchoBaseInt16ListResult_Success_DEFAULT []int16 + +func (p *TestServiceEchoBaseInt16ListResult) GetSuccess() (v []int16) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt16ListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseInt16ListResult) SetSuccess(x interface{}) { + p.Success = x.([]int16) +} + +func (p *TestServiceEchoBaseInt16ListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt16ListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt16ListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseInt16ListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt32ListArgs struct { + Req []int32 `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseInt32ListArgs() *TestServiceEchoBaseInt32ListArgs { + return &TestServiceEchoBaseInt32ListArgs{} +} + +func (p *TestServiceEchoBaseInt32ListArgs) InitDefault() { + *p = TestServiceEchoBaseInt32ListArgs{} +} + +func (p *TestServiceEchoBaseInt32ListArgs) GetReq() (v []int32) { + return p.Req +} +func (p *TestServiceEchoBaseInt32ListArgs) SetReq(val []int32) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt32ListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt32ListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseInt32ListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt32ListResult struct { + Success []int32 `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt32ListResult() *TestServiceEchoBaseInt32ListResult { + return &TestServiceEchoBaseInt32ListResult{} +} + +func (p *TestServiceEchoBaseInt32ListResult) InitDefault() { + *p = TestServiceEchoBaseInt32ListResult{} +} + +var TestServiceEchoBaseInt32ListResult_Success_DEFAULT []int32 + +func (p *TestServiceEchoBaseInt32ListResult) GetSuccess() (v []int32) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt32ListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseInt32ListResult) SetSuccess(x interface{}) { + p.Success = x.([]int32) +} + +func (p *TestServiceEchoBaseInt32ListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt32ListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt32ListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseInt32ListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseInt64ListArgs struct { + Req []int64 `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseInt64ListArgs() *TestServiceEchoBaseInt64ListArgs { + return &TestServiceEchoBaseInt64ListArgs{} +} + +func (p *TestServiceEchoBaseInt64ListArgs) InitDefault() { + *p = TestServiceEchoBaseInt64ListArgs{} +} + +func (p *TestServiceEchoBaseInt64ListArgs) GetReq() (v []int64) { + return p.Req +} +func (p *TestServiceEchoBaseInt64ListArgs) SetReq(val []int64) { + p.Req = val +} + +func (p *TestServiceEchoBaseInt64ListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt64ListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseInt64ListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseInt64ListResult struct { + Success []int64 `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseInt64ListResult() *TestServiceEchoBaseInt64ListResult { + return &TestServiceEchoBaseInt64ListResult{} +} + +func (p *TestServiceEchoBaseInt64ListResult) InitDefault() { + *p = TestServiceEchoBaseInt64ListResult{} +} + +var TestServiceEchoBaseInt64ListResult_Success_DEFAULT []int64 + +func (p *TestServiceEchoBaseInt64ListResult) GetSuccess() (v []int64) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseInt64ListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseInt64ListResult) SetSuccess(x interface{}) { + p.Success = x.([]int64) +} + +func (p *TestServiceEchoBaseInt64ListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseInt64ListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseInt64ListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseInt64ListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBaseDoubleListArgs struct { + Req []float64 `thrift:"req,1" frugal:"1,default,list" json:"req"` +} + +func NewTestServiceEchoBaseDoubleListArgs() *TestServiceEchoBaseDoubleListArgs { + return &TestServiceEchoBaseDoubleListArgs{} +} + +func (p *TestServiceEchoBaseDoubleListArgs) InitDefault() { + *p = TestServiceEchoBaseDoubleListArgs{} +} + +func (p *TestServiceEchoBaseDoubleListArgs) GetReq() (v []float64) { + return p.Req +} +func (p *TestServiceEchoBaseDoubleListArgs) SetReq(val []float64) { + p.Req = val +} + +func (p *TestServiceEchoBaseDoubleListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseDoubleListArgs(%+v)", *p) +} +func (p *TestServiceEchoBaseDoubleListArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBaseDoubleListResult struct { + Success []float64 `thrift:"success,0,optional" frugal:"0,optional,list" json:"success,omitempty"` +} + +func NewTestServiceEchoBaseDoubleListResult() *TestServiceEchoBaseDoubleListResult { + return &TestServiceEchoBaseDoubleListResult{} +} + +func (p *TestServiceEchoBaseDoubleListResult) InitDefault() { + *p = TestServiceEchoBaseDoubleListResult{} +} + +var TestServiceEchoBaseDoubleListResult_Success_DEFAULT []float64 + +func (p *TestServiceEchoBaseDoubleListResult) GetSuccess() (v []float64) { + if !p.IsSetSuccess() { + return TestServiceEchoBaseDoubleListResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBaseDoubleListResult) SetSuccess(x interface{}) { + p.Success = x.([]float64) +} + +func (p *TestServiceEchoBaseDoubleListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBaseDoubleListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBaseDoubleListResult(%+v)", *p) +} +func (p *TestServiceEchoBaseDoubleListResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2BoolBaseMapArgs struct { + Req map[bool]bool `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2BoolBaseMapArgs() *TestServiceEchoBool2BoolBaseMapArgs { + return &TestServiceEchoBool2BoolBaseMapArgs{} +} + +func (p *TestServiceEchoBool2BoolBaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2BoolBaseMapArgs{} +} + +func (p *TestServiceEchoBool2BoolBaseMapArgs) GetReq() (v map[bool]bool) { + return p.Req +} +func (p *TestServiceEchoBool2BoolBaseMapArgs) SetReq(val map[bool]bool) { + p.Req = val +} + +func (p *TestServiceEchoBool2BoolBaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2BoolBaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2BoolBaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2BoolBaseMapResult struct { + Success map[bool]bool `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2BoolBaseMapResult() *TestServiceEchoBool2BoolBaseMapResult { + return &TestServiceEchoBool2BoolBaseMapResult{} +} + +func (p *TestServiceEchoBool2BoolBaseMapResult) InitDefault() { + *p = TestServiceEchoBool2BoolBaseMapResult{} +} + +var TestServiceEchoBool2BoolBaseMapResult_Success_DEFAULT map[bool]bool + +func (p *TestServiceEchoBool2BoolBaseMapResult) GetSuccess() (v map[bool]bool) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2BoolBaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2BoolBaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]bool) +} + +func (p *TestServiceEchoBool2BoolBaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2BoolBaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2BoolBaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2BoolBaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2ByteBaseMapArgs struct { + Req map[bool]int8 `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2ByteBaseMapArgs() *TestServiceEchoBool2ByteBaseMapArgs { + return &TestServiceEchoBool2ByteBaseMapArgs{} +} + +func (p *TestServiceEchoBool2ByteBaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2ByteBaseMapArgs{} +} + +func (p *TestServiceEchoBool2ByteBaseMapArgs) GetReq() (v map[bool]int8) { + return p.Req +} +func (p *TestServiceEchoBool2ByteBaseMapArgs) SetReq(val map[bool]int8) { + p.Req = val +} + +func (p *TestServiceEchoBool2ByteBaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2ByteBaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2ByteBaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2ByteBaseMapResult struct { + Success map[bool]int8 `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2ByteBaseMapResult() *TestServiceEchoBool2ByteBaseMapResult { + return &TestServiceEchoBool2ByteBaseMapResult{} +} + +func (p *TestServiceEchoBool2ByteBaseMapResult) InitDefault() { + *p = TestServiceEchoBool2ByteBaseMapResult{} +} + +var TestServiceEchoBool2ByteBaseMapResult_Success_DEFAULT map[bool]int8 + +func (p *TestServiceEchoBool2ByteBaseMapResult) GetSuccess() (v map[bool]int8) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2ByteBaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2ByteBaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]int8) +} + +func (p *TestServiceEchoBool2ByteBaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2ByteBaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2ByteBaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2ByteBaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2Int16BaseMapArgs struct { + Req map[bool]int16 `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2Int16BaseMapArgs() *TestServiceEchoBool2Int16BaseMapArgs { + return &TestServiceEchoBool2Int16BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int16BaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2Int16BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int16BaseMapArgs) GetReq() (v map[bool]int16) { + return p.Req +} +func (p *TestServiceEchoBool2Int16BaseMapArgs) SetReq(val map[bool]int16) { + p.Req = val +} + +func (p *TestServiceEchoBool2Int16BaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int16BaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2Int16BaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2Int16BaseMapResult struct { + Success map[bool]int16 `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2Int16BaseMapResult() *TestServiceEchoBool2Int16BaseMapResult { + return &TestServiceEchoBool2Int16BaseMapResult{} +} + +func (p *TestServiceEchoBool2Int16BaseMapResult) InitDefault() { + *p = TestServiceEchoBool2Int16BaseMapResult{} +} + +var TestServiceEchoBool2Int16BaseMapResult_Success_DEFAULT map[bool]int16 + +func (p *TestServiceEchoBool2Int16BaseMapResult) GetSuccess() (v map[bool]int16) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2Int16BaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2Int16BaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]int16) +} + +func (p *TestServiceEchoBool2Int16BaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2Int16BaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int16BaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2Int16BaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2Int32BaseMapArgs struct { + Req map[bool]int32 `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2Int32BaseMapArgs() *TestServiceEchoBool2Int32BaseMapArgs { + return &TestServiceEchoBool2Int32BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int32BaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2Int32BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int32BaseMapArgs) GetReq() (v map[bool]int32) { + return p.Req +} +func (p *TestServiceEchoBool2Int32BaseMapArgs) SetReq(val map[bool]int32) { + p.Req = val +} + +func (p *TestServiceEchoBool2Int32BaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int32BaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2Int32BaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2Int32BaseMapResult struct { + Success map[bool]int32 `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2Int32BaseMapResult() *TestServiceEchoBool2Int32BaseMapResult { + return &TestServiceEchoBool2Int32BaseMapResult{} +} + +func (p *TestServiceEchoBool2Int32BaseMapResult) InitDefault() { + *p = TestServiceEchoBool2Int32BaseMapResult{} +} + +var TestServiceEchoBool2Int32BaseMapResult_Success_DEFAULT map[bool]int32 + +func (p *TestServiceEchoBool2Int32BaseMapResult) GetSuccess() (v map[bool]int32) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2Int32BaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2Int32BaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]int32) +} + +func (p *TestServiceEchoBool2Int32BaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2Int32BaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int32BaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2Int32BaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2Int64BaseMapArgs struct { + Req map[bool]int64 `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2Int64BaseMapArgs() *TestServiceEchoBool2Int64BaseMapArgs { + return &TestServiceEchoBool2Int64BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int64BaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2Int64BaseMapArgs{} +} + +func (p *TestServiceEchoBool2Int64BaseMapArgs) GetReq() (v map[bool]int64) { + return p.Req +} +func (p *TestServiceEchoBool2Int64BaseMapArgs) SetReq(val map[bool]int64) { + p.Req = val +} + +func (p *TestServiceEchoBool2Int64BaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int64BaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2Int64BaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2Int64BaseMapResult struct { + Success map[bool]int64 `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2Int64BaseMapResult() *TestServiceEchoBool2Int64BaseMapResult { + return &TestServiceEchoBool2Int64BaseMapResult{} +} + +func (p *TestServiceEchoBool2Int64BaseMapResult) InitDefault() { + *p = TestServiceEchoBool2Int64BaseMapResult{} +} + +var TestServiceEchoBool2Int64BaseMapResult_Success_DEFAULT map[bool]int64 + +func (p *TestServiceEchoBool2Int64BaseMapResult) GetSuccess() (v map[bool]int64) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2Int64BaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2Int64BaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]int64) +} + +func (p *TestServiceEchoBool2Int64BaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2Int64BaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2Int64BaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2Int64BaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoBool2DoubleBaseMapArgs struct { + Req map[bool]float64 `thrift:"req,1" frugal:"1,default,map" json:"req"` +} + +func NewTestServiceEchoBool2DoubleBaseMapArgs() *TestServiceEchoBool2DoubleBaseMapArgs { + return &TestServiceEchoBool2DoubleBaseMapArgs{} +} + +func (p *TestServiceEchoBool2DoubleBaseMapArgs) InitDefault() { + *p = TestServiceEchoBool2DoubleBaseMapArgs{} +} + +func (p *TestServiceEchoBool2DoubleBaseMapArgs) GetReq() (v map[bool]float64) { + return p.Req +} +func (p *TestServiceEchoBool2DoubleBaseMapArgs) SetReq(val map[bool]float64) { + p.Req = val +} + +func (p *TestServiceEchoBool2DoubleBaseMapArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2DoubleBaseMapArgs(%+v)", *p) +} +func (p *TestServiceEchoBool2DoubleBaseMapArgs) GetFirstArgument() interface{} { + return p.Req +} + +type TestServiceEchoBool2DoubleBaseMapResult struct { + Success map[bool]float64 `thrift:"success,0,optional" frugal:"0,optional,map" json:"success,omitempty"` +} + +func NewTestServiceEchoBool2DoubleBaseMapResult() *TestServiceEchoBool2DoubleBaseMapResult { + return &TestServiceEchoBool2DoubleBaseMapResult{} +} + +func (p *TestServiceEchoBool2DoubleBaseMapResult) InitDefault() { + *p = TestServiceEchoBool2DoubleBaseMapResult{} +} + +var TestServiceEchoBool2DoubleBaseMapResult_Success_DEFAULT map[bool]float64 + +func (p *TestServiceEchoBool2DoubleBaseMapResult) GetSuccess() (v map[bool]float64) { + if !p.IsSetSuccess() { + return TestServiceEchoBool2DoubleBaseMapResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoBool2DoubleBaseMapResult) SetSuccess(x interface{}) { + p.Success = x.(map[bool]float64) +} + +func (p *TestServiceEchoBool2DoubleBaseMapResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoBool2DoubleBaseMapResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoBool2DoubleBaseMapResult(%+v)", *p) +} +func (p *TestServiceEchoBool2DoubleBaseMapResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseBoolArgs struct { + BaseReq bool `thrift:"baseReq,1" frugal:"1,default,bool" json:"baseReq"` + ListReq []bool `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[bool]bool `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseBoolArgs() *TestServiceEchoMultiBaseBoolArgs { + return &TestServiceEchoMultiBaseBoolArgs{} +} + +func (p *TestServiceEchoMultiBaseBoolArgs) InitDefault() { + *p = TestServiceEchoMultiBaseBoolArgs{} +} + +func (p *TestServiceEchoMultiBaseBoolArgs) GetBaseReq() (v bool) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseBoolArgs) GetListReq() (v []bool) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseBoolArgs) GetMapReq() (v map[bool]bool) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseBoolArgs) SetBaseReq(val bool) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseBoolArgs) SetListReq(val []bool) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseBoolArgs) SetMapReq(val map[bool]bool) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseBoolArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseBoolArgs(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseBoolArgs) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseBoolResult struct { + Success *EchoMultiBoolResponse `thrift:"success,0,optional" frugal:"0,optional,EchoMultiBoolResponse" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseBoolResult() *TestServiceEchoMultiBaseBoolResult { + return &TestServiceEchoMultiBaseBoolResult{} +} + +func (p *TestServiceEchoMultiBaseBoolResult) InitDefault() { + *p = TestServiceEchoMultiBaseBoolResult{} +} + +var TestServiceEchoMultiBaseBoolResult_Success_DEFAULT *EchoMultiBoolResponse + +func (p *TestServiceEchoMultiBaseBoolResult) GetSuccess() (v *EchoMultiBoolResponse) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseBoolResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseBoolResult) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiBoolResponse) +} + +func (p *TestServiceEchoMultiBaseBoolResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseBoolResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseBoolResult(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseBoolResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseByteArgs struct { + BaseReq int8 `thrift:"baseReq,1" frugal:"1,default,byte" json:"baseReq"` + ListReq []int8 `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[int8]int8 `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseByteArgs() *TestServiceEchoMultiBaseByteArgs { + return &TestServiceEchoMultiBaseByteArgs{} +} + +func (p *TestServiceEchoMultiBaseByteArgs) InitDefault() { + *p = TestServiceEchoMultiBaseByteArgs{} +} + +func (p *TestServiceEchoMultiBaseByteArgs) GetBaseReq() (v int8) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseByteArgs) GetListReq() (v []int8) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseByteArgs) GetMapReq() (v map[int8]int8) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseByteArgs) SetBaseReq(val int8) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseByteArgs) SetListReq(val []int8) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseByteArgs) SetMapReq(val map[int8]int8) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseByteArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseByteArgs(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseByteArgs) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseByteResult struct { + Success *EchoMultiByteResponse `thrift:"success,0,optional" frugal:"0,optional,EchoMultiByteResponse" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseByteResult() *TestServiceEchoMultiBaseByteResult { + return &TestServiceEchoMultiBaseByteResult{} +} + +func (p *TestServiceEchoMultiBaseByteResult) InitDefault() { + *p = TestServiceEchoMultiBaseByteResult{} +} + +var TestServiceEchoMultiBaseByteResult_Success_DEFAULT *EchoMultiByteResponse + +func (p *TestServiceEchoMultiBaseByteResult) GetSuccess() (v *EchoMultiByteResponse) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseByteResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseByteResult) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiByteResponse) +} + +func (p *TestServiceEchoMultiBaseByteResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseByteResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseByteResult(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseByteResult) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseInt16Args struct { + BaseReq int16 `thrift:"baseReq,1" frugal:"1,default,i16" json:"baseReq"` + ListReq []int16 `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[int16]int16 `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseInt16Args() *TestServiceEchoMultiBaseInt16Args { + return &TestServiceEchoMultiBaseInt16Args{} +} + +func (p *TestServiceEchoMultiBaseInt16Args) InitDefault() { + *p = TestServiceEchoMultiBaseInt16Args{} +} + +func (p *TestServiceEchoMultiBaseInt16Args) GetBaseReq() (v int16) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseInt16Args) GetListReq() (v []int16) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseInt16Args) GetMapReq() (v map[int16]int16) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseInt16Args) SetBaseReq(val int16) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseInt16Args) SetListReq(val []int16) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseInt16Args) SetMapReq(val map[int16]int16) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseInt16Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt16Args(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt16Args) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseInt16Result struct { + Success *EchoMultiInt16Response `thrift:"success,0,optional" frugal:"0,optional,EchoMultiInt16Response" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseInt16Result() *TestServiceEchoMultiBaseInt16Result { + return &TestServiceEchoMultiBaseInt16Result{} +} + +func (p *TestServiceEchoMultiBaseInt16Result) InitDefault() { + *p = TestServiceEchoMultiBaseInt16Result{} +} + +var TestServiceEchoMultiBaseInt16Result_Success_DEFAULT *EchoMultiInt16Response + +func (p *TestServiceEchoMultiBaseInt16Result) GetSuccess() (v *EchoMultiInt16Response) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseInt16Result_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseInt16Result) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiInt16Response) +} + +func (p *TestServiceEchoMultiBaseInt16Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseInt16Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt16Result(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt16Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseInt32Args struct { + BaseReq int32 `thrift:"baseReq,1" frugal:"1,default,i32" json:"baseReq"` + ListReq []int32 `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[int32]int32 `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseInt32Args() *TestServiceEchoMultiBaseInt32Args { + return &TestServiceEchoMultiBaseInt32Args{} +} + +func (p *TestServiceEchoMultiBaseInt32Args) InitDefault() { + *p = TestServiceEchoMultiBaseInt32Args{} +} + +func (p *TestServiceEchoMultiBaseInt32Args) GetBaseReq() (v int32) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseInt32Args) GetListReq() (v []int32) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseInt32Args) GetMapReq() (v map[int32]int32) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseInt32Args) SetBaseReq(val int32) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseInt32Args) SetListReq(val []int32) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseInt32Args) SetMapReq(val map[int32]int32) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseInt32Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt32Args(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt32Args) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseInt32Result struct { + Success *EchoMultiInt32Response `thrift:"success,0,optional" frugal:"0,optional,EchoMultiInt32Response" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseInt32Result() *TestServiceEchoMultiBaseInt32Result { + return &TestServiceEchoMultiBaseInt32Result{} +} + +func (p *TestServiceEchoMultiBaseInt32Result) InitDefault() { + *p = TestServiceEchoMultiBaseInt32Result{} +} + +var TestServiceEchoMultiBaseInt32Result_Success_DEFAULT *EchoMultiInt32Response + +func (p *TestServiceEchoMultiBaseInt32Result) GetSuccess() (v *EchoMultiInt32Response) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseInt32Result_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseInt32Result) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiInt32Response) +} + +func (p *TestServiceEchoMultiBaseInt32Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseInt32Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt32Result(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt32Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseInt64Args struct { + BaseReq int64 `thrift:"baseReq,1" frugal:"1,default,i64" json:"baseReq"` + ListReq []int64 `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[int64]int64 `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseInt64Args() *TestServiceEchoMultiBaseInt64Args { + return &TestServiceEchoMultiBaseInt64Args{} +} + +func (p *TestServiceEchoMultiBaseInt64Args) InitDefault() { + *p = TestServiceEchoMultiBaseInt64Args{} +} + +func (p *TestServiceEchoMultiBaseInt64Args) GetBaseReq() (v int64) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseInt64Args) GetListReq() (v []int64) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseInt64Args) GetMapReq() (v map[int64]int64) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseInt64Args) SetBaseReq(val int64) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseInt64Args) SetListReq(val []int64) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseInt64Args) SetMapReq(val map[int64]int64) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseInt64Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt64Args(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt64Args) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseInt64Result struct { + Success *EchoMultiInt64Response `thrift:"success,0,optional" frugal:"0,optional,EchoMultiInt64Response" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseInt64Result() *TestServiceEchoMultiBaseInt64Result { + return &TestServiceEchoMultiBaseInt64Result{} +} + +func (p *TestServiceEchoMultiBaseInt64Result) InitDefault() { + *p = TestServiceEchoMultiBaseInt64Result{} +} + +var TestServiceEchoMultiBaseInt64Result_Success_DEFAULT *EchoMultiInt64Response + +func (p *TestServiceEchoMultiBaseInt64Result) GetSuccess() (v *EchoMultiInt64Response) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseInt64Result_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseInt64Result) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiInt64Response) +} + +func (p *TestServiceEchoMultiBaseInt64Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseInt64Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseInt64Result(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseInt64Result) GetResult() interface{} { + return p.Success +} + +type TestServiceEchoMultiBaseDoubleArgs struct { + BaseReq float64 `thrift:"baseReq,1" frugal:"1,default,double" json:"baseReq"` + ListReq []float64 `thrift:"listReq,2" frugal:"2,default,list" json:"listReq"` + MapReq map[float64]float64 `thrift:"mapReq,3" frugal:"3,default,map" json:"mapReq"` +} + +func NewTestServiceEchoMultiBaseDoubleArgs() *TestServiceEchoMultiBaseDoubleArgs { + return &TestServiceEchoMultiBaseDoubleArgs{} +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) InitDefault() { + *p = TestServiceEchoMultiBaseDoubleArgs{} +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) GetBaseReq() (v float64) { + return p.BaseReq +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) GetListReq() (v []float64) { + return p.ListReq +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) GetMapReq() (v map[float64]float64) { + return p.MapReq +} +func (p *TestServiceEchoMultiBaseDoubleArgs) SetBaseReq(val float64) { + p.BaseReq = val +} +func (p *TestServiceEchoMultiBaseDoubleArgs) SetListReq(val []float64) { + p.ListReq = val +} +func (p *TestServiceEchoMultiBaseDoubleArgs) SetMapReq(val map[float64]float64) { + p.MapReq = val +} + +func (p *TestServiceEchoMultiBaseDoubleArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseDoubleArgs(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseDoubleArgs) GetFirstArgument() interface{} { + return p.BaseReq +} + +type TestServiceEchoMultiBaseDoubleResult struct { + Success *EchoMultiDoubleResponse `thrift:"success,0,optional" frugal:"0,optional,EchoMultiDoubleResponse" json:"success,omitempty"` +} + +func NewTestServiceEchoMultiBaseDoubleResult() *TestServiceEchoMultiBaseDoubleResult { + return &TestServiceEchoMultiBaseDoubleResult{} +} + +func (p *TestServiceEchoMultiBaseDoubleResult) InitDefault() { + *p = TestServiceEchoMultiBaseDoubleResult{} +} + +var TestServiceEchoMultiBaseDoubleResult_Success_DEFAULT *EchoMultiDoubleResponse + +func (p *TestServiceEchoMultiBaseDoubleResult) GetSuccess() (v *EchoMultiDoubleResponse) { + if !p.IsSetSuccess() { + return TestServiceEchoMultiBaseDoubleResult_Success_DEFAULT + } + return p.Success +} +func (p *TestServiceEchoMultiBaseDoubleResult) SetSuccess(x interface{}) { + p.Success = x.(*EchoMultiDoubleResponse) +} + +func (p *TestServiceEchoMultiBaseDoubleResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TestServiceEchoMultiBaseDoubleResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestServiceEchoMultiBaseDoubleResult(%+v)", *p) +} +func (p *TestServiceEchoMultiBaseDoubleResult) GetResult() interface{} { + return p.Success +} diff --git a/tests/kitex/kitex_gen/echo/testservice/client.go b/tests/kitex/kitex_gen/echo/testservice/client.go index 1b3400a3..48b30a28 100644 --- a/tests/kitex/kitex_gen/echo/testservice/client.go +++ b/tests/kitex/kitex_gen/echo/testservice/client.go @@ -1,4 +1,4 @@ -// Code generated by Kitex v0.7.2. DO NOT EDIT. +// Code generated by Kitex v0.7.3. DO NOT EDIT. package testservice @@ -52,6 +52,30 @@ type Client interface { EchoMultiInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64, callOptions ...callopt.Option) (r *echo.EchoMultiInt64Response, err error) EchoMultiDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64, callOptions ...callopt.Option) (r *echo.EchoMultiDoubleResponse, err error) EchoMultiString(ctx context.Context, baseReq string, listReq []string, mapReq map[string]string, callOptions ...callopt.Option) (r *echo.EchoMultiStringResponse, err error) + EchoBaseBool(ctx context.Context, req bool, callOptions ...callopt.Option) (r bool, err error) + EchoBaseByte(ctx context.Context, req int8, callOptions ...callopt.Option) (r int8, err error) + EchoBaseInt16(ctx context.Context, req int16, callOptions ...callopt.Option) (r int16, err error) + EchoBaseInt32(ctx context.Context, req int32, callOptions ...callopt.Option) (r int32, err error) + EchoBaseInt64(ctx context.Context, req int64, callOptions ...callopt.Option) (r int64, err error) + EchoBaseDouble(ctx context.Context, req float64, callOptions ...callopt.Option) (r float64, err error) + EchoBaseBoolList(ctx context.Context, req []bool, callOptions ...callopt.Option) (r []bool, err error) + EchoBaseByteList(ctx context.Context, req []int8, callOptions ...callopt.Option) (r []int8, err error) + EchoBaseInt16List(ctx context.Context, req []int16, callOptions ...callopt.Option) (r []int16, err error) + EchoBaseInt32List(ctx context.Context, req []int32, callOptions ...callopt.Option) (r []int32, err error) + EchoBaseInt64List(ctx context.Context, req []int64, callOptions ...callopt.Option) (r []int64, err error) + EchoBaseDoubleList(ctx context.Context, req []float64, callOptions ...callopt.Option) (r []float64, err error) + EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool, callOptions ...callopt.Option) (r map[bool]bool, err error) + EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8, callOptions ...callopt.Option) (r map[bool]int8, err error) + EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16, callOptions ...callopt.Option) (r map[bool]int16, err error) + EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32, callOptions ...callopt.Option) (r map[bool]int32, err error) + EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64, callOptions ...callopt.Option) (r map[bool]int64, err error) + EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64, callOptions ...callopt.Option) (r map[bool]float64, err error) + EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool, callOptions ...callopt.Option) (r *echo.EchoMultiBoolResponse, err error) + EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8, callOptions ...callopt.Option) (r *echo.EchoMultiByteResponse, err error) + EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16, callOptions ...callopt.Option) (r *echo.EchoMultiInt16Response, err error) + EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32, callOptions ...callopt.Option) (r *echo.EchoMultiInt32Response, err error) + EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64, callOptions ...callopt.Option) (r *echo.EchoMultiInt64Response, err error) + EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64, callOptions ...callopt.Option) (r *echo.EchoMultiDoubleResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -287,3 +311,123 @@ func (p *kTestServiceClient) EchoMultiString(ctx context.Context, baseReq string ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.EchoMultiString(ctx, baseReq, listReq, mapReq) } + +func (p *kTestServiceClient) EchoBaseBool(ctx context.Context, req bool, callOptions ...callopt.Option) (r bool, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseBool(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseByte(ctx context.Context, req int8, callOptions ...callopt.Option) (r int8, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseByte(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt16(ctx context.Context, req int16, callOptions ...callopt.Option) (r int16, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt16(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt32(ctx context.Context, req int32, callOptions ...callopt.Option) (r int32, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt32(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt64(ctx context.Context, req int64, callOptions ...callopt.Option) (r int64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt64(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseDouble(ctx context.Context, req float64, callOptions ...callopt.Option) (r float64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseDouble(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseBoolList(ctx context.Context, req []bool, callOptions ...callopt.Option) (r []bool, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseBoolList(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseByteList(ctx context.Context, req []int8, callOptions ...callopt.Option) (r []int8, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseByteList(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt16List(ctx context.Context, req []int16, callOptions ...callopt.Option) (r []int16, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt16List(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt32List(ctx context.Context, req []int32, callOptions ...callopt.Option) (r []int32, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt32List(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseInt64List(ctx context.Context, req []int64, callOptions ...callopt.Option) (r []int64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseInt64List(ctx, req) +} + +func (p *kTestServiceClient) EchoBaseDoubleList(ctx context.Context, req []float64, callOptions ...callopt.Option) (r []float64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBaseDoubleList(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool, callOptions ...callopt.Option) (r map[bool]bool, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2BoolBaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8, callOptions ...callopt.Option) (r map[bool]int8, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2ByteBaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16, callOptions ...callopt.Option) (r map[bool]int16, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2Int16BaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32, callOptions ...callopt.Option) (r map[bool]int32, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2Int32BaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64, callOptions ...callopt.Option) (r map[bool]int64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2Int64BaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64, callOptions ...callopt.Option) (r map[bool]float64, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoBool2DoubleBaseMap(ctx, req) +} + +func (p *kTestServiceClient) EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool, callOptions ...callopt.Option) (r *echo.EchoMultiBoolResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseBool(ctx, baseReq, listReq, mapReq) +} + +func (p *kTestServiceClient) EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8, callOptions ...callopt.Option) (r *echo.EchoMultiByteResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseByte(ctx, baseReq, listReq, mapReq) +} + +func (p *kTestServiceClient) EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16, callOptions ...callopt.Option) (r *echo.EchoMultiInt16Response, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseInt16(ctx, baseReq, listReq, mapReq) +} + +func (p *kTestServiceClient) EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32, callOptions ...callopt.Option) (r *echo.EchoMultiInt32Response, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseInt32(ctx, baseReq, listReq, mapReq) +} + +func (p *kTestServiceClient) EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64, callOptions ...callopt.Option) (r *echo.EchoMultiInt64Response, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseInt64(ctx, baseReq, listReq, mapReq) +} + +func (p *kTestServiceClient) EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64, callOptions ...callopt.Option) (r *echo.EchoMultiDoubleResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.EchoMultiBaseDouble(ctx, baseReq, listReq, mapReq) +} diff --git a/tests/kitex/kitex_gen/echo/testservice/invoker.go b/tests/kitex/kitex_gen/echo/testservice/invoker.go index 807c7835..639e4dae 100644 --- a/tests/kitex/kitex_gen/echo/testservice/invoker.go +++ b/tests/kitex/kitex_gen/echo/testservice/invoker.go @@ -1,4 +1,4 @@ -// Code generated by Kitex v0.7.2. DO NOT EDIT. +// Code generated by Kitex v0.7.3. DO NOT EDIT. package testservice diff --git a/tests/kitex/kitex_gen/echo/testservice/server.go b/tests/kitex/kitex_gen/echo/testservice/server.go index d4a54976..097854d8 100644 --- a/tests/kitex/kitex_gen/echo/testservice/server.go +++ b/tests/kitex/kitex_gen/echo/testservice/server.go @@ -1,4 +1,4 @@ -// Code generated by Kitex v0.7.2. DO NOT EDIT. +// Code generated by Kitex v0.7.3. DO NOT EDIT. package testservice import ( diff --git a/tests/kitex/kitex_gen/echo/testservice/testservice.go b/tests/kitex/kitex_gen/echo/testservice/testservice.go index 32cbccb2..81722538 100644 --- a/tests/kitex/kitex_gen/echo/testservice/testservice.go +++ b/tests/kitex/kitex_gen/echo/testservice/testservice.go @@ -1,4 +1,4 @@ -// Code generated by Kitex v0.7.2. DO NOT EDIT. +// Code generated by Kitex v0.7.3. DO NOT EDIT. package testservice @@ -60,6 +60,30 @@ func NewServiceInfo() *kitex.ServiceInfo { "EchoMultiInt64": kitex.NewMethodInfo(echoMultiInt64Handler, newTestServiceEchoMultiInt64Args, newTestServiceEchoMultiInt64Result, false), "EchoMultiDouble": kitex.NewMethodInfo(echoMultiDoubleHandler, newTestServiceEchoMultiDoubleArgs, newTestServiceEchoMultiDoubleResult, false), "EchoMultiString": kitex.NewMethodInfo(echoMultiStringHandler, newTestServiceEchoMultiStringArgs, newTestServiceEchoMultiStringResult, false), + "EchoBaseBool": kitex.NewMethodInfo(echoBaseBoolHandler, newTestServiceEchoBaseBoolArgs, newTestServiceEchoBaseBoolResult, false), + "EchoBaseByte": kitex.NewMethodInfo(echoBaseByteHandler, newTestServiceEchoBaseByteArgs, newTestServiceEchoBaseByteResult, false), + "EchoBaseInt16": kitex.NewMethodInfo(echoBaseInt16Handler, newTestServiceEchoBaseInt16Args, newTestServiceEchoBaseInt16Result, false), + "EchoBaseInt32": kitex.NewMethodInfo(echoBaseInt32Handler, newTestServiceEchoBaseInt32Args, newTestServiceEchoBaseInt32Result, false), + "EchoBaseInt64": kitex.NewMethodInfo(echoBaseInt64Handler, newTestServiceEchoBaseInt64Args, newTestServiceEchoBaseInt64Result, false), + "EchoBaseDouble": kitex.NewMethodInfo(echoBaseDoubleHandler, newTestServiceEchoBaseDoubleArgs, newTestServiceEchoBaseDoubleResult, false), + "EchoBaseBoolList": kitex.NewMethodInfo(echoBaseBoolListHandler, newTestServiceEchoBaseBoolListArgs, newTestServiceEchoBaseBoolListResult, false), + "EchoBaseByteList": kitex.NewMethodInfo(echoBaseByteListHandler, newTestServiceEchoBaseByteListArgs, newTestServiceEchoBaseByteListResult, false), + "EchoBaseInt16List": kitex.NewMethodInfo(echoBaseInt16ListHandler, newTestServiceEchoBaseInt16ListArgs, newTestServiceEchoBaseInt16ListResult, false), + "EchoBaseInt32List": kitex.NewMethodInfo(echoBaseInt32ListHandler, newTestServiceEchoBaseInt32ListArgs, newTestServiceEchoBaseInt32ListResult, false), + "EchoBaseInt64List": kitex.NewMethodInfo(echoBaseInt64ListHandler, newTestServiceEchoBaseInt64ListArgs, newTestServiceEchoBaseInt64ListResult, false), + "EchoBaseDoubleList": kitex.NewMethodInfo(echoBaseDoubleListHandler, newTestServiceEchoBaseDoubleListArgs, newTestServiceEchoBaseDoubleListResult, false), + "EchoBool2BoolBaseMap": kitex.NewMethodInfo(echoBool2BoolBaseMapHandler, newTestServiceEchoBool2BoolBaseMapArgs, newTestServiceEchoBool2BoolBaseMapResult, false), + "EchoBool2ByteBaseMap": kitex.NewMethodInfo(echoBool2ByteBaseMapHandler, newTestServiceEchoBool2ByteBaseMapArgs, newTestServiceEchoBool2ByteBaseMapResult, false), + "EchoBool2Int16BaseMap": kitex.NewMethodInfo(echoBool2Int16BaseMapHandler, newTestServiceEchoBool2Int16BaseMapArgs, newTestServiceEchoBool2Int16BaseMapResult, false), + "EchoBool2Int32BaseMap": kitex.NewMethodInfo(echoBool2Int32BaseMapHandler, newTestServiceEchoBool2Int32BaseMapArgs, newTestServiceEchoBool2Int32BaseMapResult, false), + "EchoBool2Int64BaseMap": kitex.NewMethodInfo(echoBool2Int64BaseMapHandler, newTestServiceEchoBool2Int64BaseMapArgs, newTestServiceEchoBool2Int64BaseMapResult, false), + "EchoBool2DoubleBaseMap": kitex.NewMethodInfo(echoBool2DoubleBaseMapHandler, newTestServiceEchoBool2DoubleBaseMapArgs, newTestServiceEchoBool2DoubleBaseMapResult, false), + "EchoMultiBaseBool": kitex.NewMethodInfo(echoMultiBaseBoolHandler, newTestServiceEchoMultiBaseBoolArgs, newTestServiceEchoMultiBaseBoolResult, false), + "EchoMultiBaseByte": kitex.NewMethodInfo(echoMultiBaseByteHandler, newTestServiceEchoMultiBaseByteArgs, newTestServiceEchoMultiBaseByteResult, false), + "EchoMultiBaseInt16": kitex.NewMethodInfo(echoMultiBaseInt16Handler, newTestServiceEchoMultiBaseInt16Args, newTestServiceEchoMultiBaseInt16Result, false), + "EchoMultiBaseInt32": kitex.NewMethodInfo(echoMultiBaseInt32Handler, newTestServiceEchoMultiBaseInt32Args, newTestServiceEchoMultiBaseInt32Result, false), + "EchoMultiBaseInt64": kitex.NewMethodInfo(echoMultiBaseInt64Handler, newTestServiceEchoMultiBaseInt64Args, newTestServiceEchoMultiBaseInt64Result, false), + "EchoMultiBaseDouble": kitex.NewMethodInfo(echoMultiBaseDoubleHandler, newTestServiceEchoMultiBaseDoubleArgs, newTestServiceEchoMultiBaseDoubleResult, false), } extra := map[string]interface{}{ "PackageName": "echo", @@ -69,7 +93,7 @@ func NewServiceInfo() *kitex.ServiceInfo { ServiceName: serviceName, HandlerType: handlerType, Methods: methods, - KiteXGenVersion: "v0.7.2", + KiteXGenVersion: "v0.7.3", Extra: extra, } return svcInfo @@ -813,6 +837,438 @@ func newTestServiceEchoMultiStringResult() interface{} { return echo.NewTestServiceEchoMultiStringResult() } +func echoBaseBoolHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseBoolArgs) + realResult := result.(*echo.TestServiceEchoBaseBoolResult) + success, err := handler.(echo.TestService).EchoBaseBool(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseBoolArgs() interface{} { + return echo.NewTestServiceEchoBaseBoolArgs() +} + +func newTestServiceEchoBaseBoolResult() interface{} { + return echo.NewTestServiceEchoBaseBoolResult() +} + +func echoBaseByteHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseByteArgs) + realResult := result.(*echo.TestServiceEchoBaseByteResult) + success, err := handler.(echo.TestService).EchoBaseByte(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseByteArgs() interface{} { + return echo.NewTestServiceEchoBaseByteArgs() +} + +func newTestServiceEchoBaseByteResult() interface{} { + return echo.NewTestServiceEchoBaseByteResult() +} + +func echoBaseInt16Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt16Args) + realResult := result.(*echo.TestServiceEchoBaseInt16Result) + success, err := handler.(echo.TestService).EchoBaseInt16(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseInt16Args() interface{} { + return echo.NewTestServiceEchoBaseInt16Args() +} + +func newTestServiceEchoBaseInt16Result() interface{} { + return echo.NewTestServiceEchoBaseInt16Result() +} + +func echoBaseInt32Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt32Args) + realResult := result.(*echo.TestServiceEchoBaseInt32Result) + success, err := handler.(echo.TestService).EchoBaseInt32(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseInt32Args() interface{} { + return echo.NewTestServiceEchoBaseInt32Args() +} + +func newTestServiceEchoBaseInt32Result() interface{} { + return echo.NewTestServiceEchoBaseInt32Result() +} + +func echoBaseInt64Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt64Args) + realResult := result.(*echo.TestServiceEchoBaseInt64Result) + success, err := handler.(echo.TestService).EchoBaseInt64(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseInt64Args() interface{} { + return echo.NewTestServiceEchoBaseInt64Args() +} + +func newTestServiceEchoBaseInt64Result() interface{} { + return echo.NewTestServiceEchoBaseInt64Result() +} + +func echoBaseDoubleHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseDoubleArgs) + realResult := result.(*echo.TestServiceEchoBaseDoubleResult) + success, err := handler.(echo.TestService).EchoBaseDouble(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = &success + return nil +} +func newTestServiceEchoBaseDoubleArgs() interface{} { + return echo.NewTestServiceEchoBaseDoubleArgs() +} + +func newTestServiceEchoBaseDoubleResult() interface{} { + return echo.NewTestServiceEchoBaseDoubleResult() +} + +func echoBaseBoolListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseBoolListArgs) + realResult := result.(*echo.TestServiceEchoBaseBoolListResult) + success, err := handler.(echo.TestService).EchoBaseBoolList(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseBoolListArgs() interface{} { + return echo.NewTestServiceEchoBaseBoolListArgs() +} + +func newTestServiceEchoBaseBoolListResult() interface{} { + return echo.NewTestServiceEchoBaseBoolListResult() +} + +func echoBaseByteListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseByteListArgs) + realResult := result.(*echo.TestServiceEchoBaseByteListResult) + success, err := handler.(echo.TestService).EchoBaseByteList(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseByteListArgs() interface{} { + return echo.NewTestServiceEchoBaseByteListArgs() +} + +func newTestServiceEchoBaseByteListResult() interface{} { + return echo.NewTestServiceEchoBaseByteListResult() +} + +func echoBaseInt16ListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt16ListArgs) + realResult := result.(*echo.TestServiceEchoBaseInt16ListResult) + success, err := handler.(echo.TestService).EchoBaseInt16List(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseInt16ListArgs() interface{} { + return echo.NewTestServiceEchoBaseInt16ListArgs() +} + +func newTestServiceEchoBaseInt16ListResult() interface{} { + return echo.NewTestServiceEchoBaseInt16ListResult() +} + +func echoBaseInt32ListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt32ListArgs) + realResult := result.(*echo.TestServiceEchoBaseInt32ListResult) + success, err := handler.(echo.TestService).EchoBaseInt32List(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseInt32ListArgs() interface{} { + return echo.NewTestServiceEchoBaseInt32ListArgs() +} + +func newTestServiceEchoBaseInt32ListResult() interface{} { + return echo.NewTestServiceEchoBaseInt32ListResult() +} + +func echoBaseInt64ListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseInt64ListArgs) + realResult := result.(*echo.TestServiceEchoBaseInt64ListResult) + success, err := handler.(echo.TestService).EchoBaseInt64List(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseInt64ListArgs() interface{} { + return echo.NewTestServiceEchoBaseInt64ListArgs() +} + +func newTestServiceEchoBaseInt64ListResult() interface{} { + return echo.NewTestServiceEchoBaseInt64ListResult() +} + +func echoBaseDoubleListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBaseDoubleListArgs) + realResult := result.(*echo.TestServiceEchoBaseDoubleListResult) + success, err := handler.(echo.TestService).EchoBaseDoubleList(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBaseDoubleListArgs() interface{} { + return echo.NewTestServiceEchoBaseDoubleListArgs() +} + +func newTestServiceEchoBaseDoubleListResult() interface{} { + return echo.NewTestServiceEchoBaseDoubleListResult() +} + +func echoBool2BoolBaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2BoolBaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2BoolBaseMapResult) + success, err := handler.(echo.TestService).EchoBool2BoolBaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2BoolBaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2BoolBaseMapArgs() +} + +func newTestServiceEchoBool2BoolBaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2BoolBaseMapResult() +} + +func echoBool2ByteBaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2ByteBaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2ByteBaseMapResult) + success, err := handler.(echo.TestService).EchoBool2ByteBaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2ByteBaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2ByteBaseMapArgs() +} + +func newTestServiceEchoBool2ByteBaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2ByteBaseMapResult() +} + +func echoBool2Int16BaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2Int16BaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2Int16BaseMapResult) + success, err := handler.(echo.TestService).EchoBool2Int16BaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2Int16BaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2Int16BaseMapArgs() +} + +func newTestServiceEchoBool2Int16BaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2Int16BaseMapResult() +} + +func echoBool2Int32BaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2Int32BaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2Int32BaseMapResult) + success, err := handler.(echo.TestService).EchoBool2Int32BaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2Int32BaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2Int32BaseMapArgs() +} + +func newTestServiceEchoBool2Int32BaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2Int32BaseMapResult() +} + +func echoBool2Int64BaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2Int64BaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2Int64BaseMapResult) + success, err := handler.(echo.TestService).EchoBool2Int64BaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2Int64BaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2Int64BaseMapArgs() +} + +func newTestServiceEchoBool2Int64BaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2Int64BaseMapResult() +} + +func echoBool2DoubleBaseMapHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoBool2DoubleBaseMapArgs) + realResult := result.(*echo.TestServiceEchoBool2DoubleBaseMapResult) + success, err := handler.(echo.TestService).EchoBool2DoubleBaseMap(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoBool2DoubleBaseMapArgs() interface{} { + return echo.NewTestServiceEchoBool2DoubleBaseMapArgs() +} + +func newTestServiceEchoBool2DoubleBaseMapResult() interface{} { + return echo.NewTestServiceEchoBool2DoubleBaseMapResult() +} + +func echoMultiBaseBoolHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseBoolArgs) + realResult := result.(*echo.TestServiceEchoMultiBaseBoolResult) + success, err := handler.(echo.TestService).EchoMultiBaseBool(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseBoolArgs() interface{} { + return echo.NewTestServiceEchoMultiBaseBoolArgs() +} + +func newTestServiceEchoMultiBaseBoolResult() interface{} { + return echo.NewTestServiceEchoMultiBaseBoolResult() +} + +func echoMultiBaseByteHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseByteArgs) + realResult := result.(*echo.TestServiceEchoMultiBaseByteResult) + success, err := handler.(echo.TestService).EchoMultiBaseByte(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseByteArgs() interface{} { + return echo.NewTestServiceEchoMultiBaseByteArgs() +} + +func newTestServiceEchoMultiBaseByteResult() interface{} { + return echo.NewTestServiceEchoMultiBaseByteResult() +} + +func echoMultiBaseInt16Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseInt16Args) + realResult := result.(*echo.TestServiceEchoMultiBaseInt16Result) + success, err := handler.(echo.TestService).EchoMultiBaseInt16(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseInt16Args() interface{} { + return echo.NewTestServiceEchoMultiBaseInt16Args() +} + +func newTestServiceEchoMultiBaseInt16Result() interface{} { + return echo.NewTestServiceEchoMultiBaseInt16Result() +} + +func echoMultiBaseInt32Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseInt32Args) + realResult := result.(*echo.TestServiceEchoMultiBaseInt32Result) + success, err := handler.(echo.TestService).EchoMultiBaseInt32(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseInt32Args() interface{} { + return echo.NewTestServiceEchoMultiBaseInt32Args() +} + +func newTestServiceEchoMultiBaseInt32Result() interface{} { + return echo.NewTestServiceEchoMultiBaseInt32Result() +} + +func echoMultiBaseInt64Handler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseInt64Args) + realResult := result.(*echo.TestServiceEchoMultiBaseInt64Result) + success, err := handler.(echo.TestService).EchoMultiBaseInt64(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseInt64Args() interface{} { + return echo.NewTestServiceEchoMultiBaseInt64Args() +} + +func newTestServiceEchoMultiBaseInt64Result() interface{} { + return echo.NewTestServiceEchoMultiBaseInt64Result() +} + +func echoMultiBaseDoubleHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*echo.TestServiceEchoMultiBaseDoubleArgs) + realResult := result.(*echo.TestServiceEchoMultiBaseDoubleResult) + success, err := handler.(echo.TestService).EchoMultiBaseDouble(ctx, realArg.BaseReq, realArg.ListReq, realArg.MapReq) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newTestServiceEchoMultiBaseDoubleArgs() interface{} { + return echo.NewTestServiceEchoMultiBaseDoubleArgs() +} + +func newTestServiceEchoMultiBaseDoubleResult() interface{} { + return echo.NewTestServiceEchoMultiBaseDoubleResult() +} + type kClient struct { c client.Client } @@ -1246,3 +1702,255 @@ func (p *kClient) EchoMultiString(ctx context.Context, baseReq string, listReq [ } return _result.GetSuccess(), nil } + +func (p *kClient) EchoBaseBool(ctx context.Context, req bool) (r bool, err error) { + var _args echo.TestServiceEchoBaseBoolArgs + _args.Req = req + var _result echo.TestServiceEchoBaseBoolResult + if err = p.c.Call(ctx, "EchoBaseBool", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseByte(ctx context.Context, req int8) (r int8, err error) { + var _args echo.TestServiceEchoBaseByteArgs + _args.Req = req + var _result echo.TestServiceEchoBaseByteResult + if err = p.c.Call(ctx, "EchoBaseByte", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt16(ctx context.Context, req int16) (r int16, err error) { + var _args echo.TestServiceEchoBaseInt16Args + _args.Req = req + var _result echo.TestServiceEchoBaseInt16Result + if err = p.c.Call(ctx, "EchoBaseInt16", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt32(ctx context.Context, req int32) (r int32, err error) { + var _args echo.TestServiceEchoBaseInt32Args + _args.Req = req + var _result echo.TestServiceEchoBaseInt32Result + if err = p.c.Call(ctx, "EchoBaseInt32", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt64(ctx context.Context, req int64) (r int64, err error) { + var _args echo.TestServiceEchoBaseInt64Args + _args.Req = req + var _result echo.TestServiceEchoBaseInt64Result + if err = p.c.Call(ctx, "EchoBaseInt64", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseDouble(ctx context.Context, req float64) (r float64, err error) { + var _args echo.TestServiceEchoBaseDoubleArgs + _args.Req = req + var _result echo.TestServiceEchoBaseDoubleResult + if err = p.c.Call(ctx, "EchoBaseDouble", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseBoolList(ctx context.Context, req []bool) (r []bool, err error) { + var _args echo.TestServiceEchoBaseBoolListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseBoolListResult + if err = p.c.Call(ctx, "EchoBaseBoolList", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseByteList(ctx context.Context, req []int8) (r []int8, err error) { + var _args echo.TestServiceEchoBaseByteListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseByteListResult + if err = p.c.Call(ctx, "EchoBaseByteList", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt16List(ctx context.Context, req []int16) (r []int16, err error) { + var _args echo.TestServiceEchoBaseInt16ListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseInt16ListResult + if err = p.c.Call(ctx, "EchoBaseInt16List", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt32List(ctx context.Context, req []int32) (r []int32, err error) { + var _args echo.TestServiceEchoBaseInt32ListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseInt32ListResult + if err = p.c.Call(ctx, "EchoBaseInt32List", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseInt64List(ctx context.Context, req []int64) (r []int64, err error) { + var _args echo.TestServiceEchoBaseInt64ListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseInt64ListResult + if err = p.c.Call(ctx, "EchoBaseInt64List", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBaseDoubleList(ctx context.Context, req []float64) (r []float64, err error) { + var _args echo.TestServiceEchoBaseDoubleListArgs + _args.Req = req + var _result echo.TestServiceEchoBaseDoubleListResult + if err = p.c.Call(ctx, "EchoBaseDoubleList", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool) (r map[bool]bool, err error) { + var _args echo.TestServiceEchoBool2BoolBaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2BoolBaseMapResult + if err = p.c.Call(ctx, "EchoBool2BoolBaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8) (r map[bool]int8, err error) { + var _args echo.TestServiceEchoBool2ByteBaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2ByteBaseMapResult + if err = p.c.Call(ctx, "EchoBool2ByteBaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16) (r map[bool]int16, err error) { + var _args echo.TestServiceEchoBool2Int16BaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2Int16BaseMapResult + if err = p.c.Call(ctx, "EchoBool2Int16BaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32) (r map[bool]int32, err error) { + var _args echo.TestServiceEchoBool2Int32BaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2Int32BaseMapResult + if err = p.c.Call(ctx, "EchoBool2Int32BaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64) (r map[bool]int64, err error) { + var _args echo.TestServiceEchoBool2Int64BaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2Int64BaseMapResult + if err = p.c.Call(ctx, "EchoBool2Int64BaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64) (r map[bool]float64, err error) { + var _args echo.TestServiceEchoBool2DoubleBaseMapArgs + _args.Req = req + var _result echo.TestServiceEchoBool2DoubleBaseMapResult + if err = p.c.Call(ctx, "EchoBool2DoubleBaseMap", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool) (r *echo.EchoMultiBoolResponse, err error) { + var _args echo.TestServiceEchoMultiBaseBoolArgs + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseBoolResult + if err = p.c.Call(ctx, "EchoMultiBaseBool", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8) (r *echo.EchoMultiByteResponse, err error) { + var _args echo.TestServiceEchoMultiBaseByteArgs + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseByteResult + if err = p.c.Call(ctx, "EchoMultiBaseByte", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16) (r *echo.EchoMultiInt16Response, err error) { + var _args echo.TestServiceEchoMultiBaseInt16Args + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseInt16Result + if err = p.c.Call(ctx, "EchoMultiBaseInt16", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32) (r *echo.EchoMultiInt32Response, err error) { + var _args echo.TestServiceEchoMultiBaseInt32Args + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseInt32Result + if err = p.c.Call(ctx, "EchoMultiBaseInt32", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64) (r *echo.EchoMultiInt64Response, err error) { + var _args echo.TestServiceEchoMultiBaseInt64Args + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseInt64Result + if err = p.c.Call(ctx, "EchoMultiBaseInt64", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64) (r *echo.EchoMultiDoubleResponse, err error) { + var _args echo.TestServiceEchoMultiBaseDoubleArgs + _args.BaseReq = baseReq + _args.ListReq = listReq + _args.MapReq = mapReq + var _result echo.TestServiceEchoMultiBaseDoubleResult + if err = p.c.Call(ctx, "EchoMultiBaseDouble", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/tests/kitex/kitex_gen/echo/testsuite/handler.go b/tests/kitex/kitex_gen/echo/testsuite/handler.go index 3d6b9a5d..fae9ec25 100644 --- a/tests/kitex/kitex_gen/echo/testsuite/handler.go +++ b/tests/kitex/kitex_gen/echo/testsuite/handler.go @@ -1,4 +1,4 @@ -package testsuite +package main import ( "context" @@ -247,3 +247,147 @@ func (s *TestServiceImpl) EchoMultiString(ctx context.Context, baseReq string, l MapResp: mapReq, }, nil } + +// EchoBaseBool implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseBool(ctx context.Context, req bool) (resp bool, err error) { + return req, nil +} + +// EchoBaseByte implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseByte(ctx context.Context, req int8) (resp int8, err error) { + return req, nil +} + +// EchoBaseInt16 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt16(ctx context.Context, req int16) (resp int16, err error) { + return req, nil +} + +// EchoBaseInt32 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt32(ctx context.Context, req int32) (resp int32, err error) { + return req, nil +} + +// EchoBaseInt64 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt64(ctx context.Context, req int64) (resp int64, err error) { + return req, nil +} + +// EchoBaseDouble implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseDouble(ctx context.Context, req float64) (resp float64, err error) { + return req, nil +} + +// EchoBaseBoolList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseBoolList(ctx context.Context, req []bool) (resp []bool, err error) { + return req, nil +} + +// EchoBaseByteList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseByteList(ctx context.Context, req []int8) (resp []int8, err error) { + return req, nil +} + +// EchoBaseInt16List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt16List(ctx context.Context, req []int16) (resp []int16, err error) { + return req, nil +} + +// EchoBaseInt32List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt32List(ctx context.Context, req []int32) (resp []int32, err error) { + return req, nil +} + +// EchoBaseInt64List implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseInt64List(ctx context.Context, req []int64) (resp []int64, err error) { + return req, nil +} + +// EchoBaseDoubleList implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBaseDoubleList(ctx context.Context, req []float64) (resp []float64, err error) { + return req, nil +} + +// EchoBool2BoolBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2BoolBaseMap(ctx context.Context, req map[bool]bool) (resp map[bool]bool, err error) { + return req, nil +} + +// EchoBool2ByteBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2ByteBaseMap(ctx context.Context, req map[bool]int8) (resp map[bool]int8, err error) { + return req, nil +} + +// EchoBool2Int16BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int16BaseMap(ctx context.Context, req map[bool]int16) (resp map[bool]int16, err error) { + return req, nil +} + +// EchoBool2Int32BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int32BaseMap(ctx context.Context, req map[bool]int32) (resp map[bool]int32, err error) { + return req, nil +} + +// EchoBool2Int64BaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2Int64BaseMap(ctx context.Context, req map[bool]int64) (resp map[bool]int64, err error) { + return req, nil +} + +// EchoBool2DoubleBaseMap implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoBool2DoubleBaseMap(ctx context.Context, req map[bool]float64) (resp map[bool]float64, err error) { + return req, nil +} + +// EchoMultiBaseBool implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseBool(ctx context.Context, baseReq bool, listReq []bool, mapReq map[bool]bool) (resp *echo.EchoMultiBoolResponse, err error) { + return &echo.EchoMultiBoolResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseByte implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseByte(ctx context.Context, baseReq int8, listReq []int8, mapReq map[int8]int8) (resp *echo.EchoMultiByteResponse, err error) { + return &echo.EchoMultiByteResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt16 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt16(ctx context.Context, baseReq int16, listReq []int16, mapReq map[int16]int16) (resp *echo.EchoMultiInt16Response, err error) { + return &echo.EchoMultiInt16Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt32 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt32(ctx context.Context, baseReq int32, listReq []int32, mapReq map[int32]int32) (resp *echo.EchoMultiInt32Response, err error) { + return &echo.EchoMultiInt32Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseInt64 implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseInt64(ctx context.Context, baseReq int64, listReq []int64, mapReq map[int64]int64) (resp *echo.EchoMultiInt64Response, err error) { + return &echo.EchoMultiInt64Response{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +} + +// EchoMultiBaseDouble implements the TestServiceImpl interface. +func (s *TestServiceImpl) EchoMultiBaseDouble(ctx context.Context, baseReq float64, listReq []float64, mapReq map[float64]float64) (resp *echo.EchoMultiDoubleResponse, err error) { + return &echo.EchoMultiDoubleResponse{ + BaseResp: baseReq, + ListResp: listReq, + MapResp: mapReq, + }, nil +}