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
import (
"fmt"
"reflect"
"testing"
"git.rosy.net.cn/baseapi"
@@ -53,26 +51,15 @@ func TestQueryStockCenter(t *testing.T) {
}
}
type TTest struct {
A int
}
func (t *TTest) Foo(param1 int, param2 string) string {
fmt.Println(param1, param2)
return utils.Int2Str(param1) + "|" + param2
}
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),
func TestBatchUpdateVendibility(t *testing.T) {
result, err := jdapi.BatchUpdateVendibility("100130", "", []*StockVendibility{
&StockVendibility{
OutSkuId: "26919",
DoSale: true,
},
}, "test")
if err != nil {
t.Fatal(err)
}
fmt.Println(funcFoo.Call(params)[0])
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
}