This commit is contained in:
gazebo
2019-03-12 17:10:16 +08:00
parent a222815fe5
commit 7286c360b2

View File

@@ -1,8 +1,6 @@
package jdapi package jdapi
import ( import (
"fmt"
"reflect"
"testing" "testing"
"git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi"
@@ -53,26 +51,15 @@ func TestQueryStockCenter(t *testing.T) {
} }
} }
type TTest struct { func TestBatchUpdateVendibility(t *testing.T) {
A int result, err := jdapi.BatchUpdateVendibility("100130", "", []*StockVendibility{
} &StockVendibility{
OutSkuId: "26919",
func (t *TTest) Foo(param1 int, param2 string) string { DoSale: true,
fmt.Println(param1, param2) },
return utils.Int2Str(param1) + "|" + param2 }, "test")
} if err != nil {
t.Fatal(err)
func TestIt(t *testing.T) {
var param1, param2 interface{}
param1 = 1
param2 = "bbb"
var tt interface{}
tt = &TTest{}
ttValue := reflect.ValueOf(tt)
funcFoo := ttValue.MethodByName("Foo")
params := []reflect.Value{
reflect.ValueOf(param1),
reflect.ValueOf(param2),
} }
fmt.Println(funcFoo.Call(params)[0]) baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
} }