- test`
This commit is contained in:
@@ -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",
|
||||||
|
DoSale: true,
|
||||||
|
},
|
||||||
|
}, "test")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||||
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),
|
|
||||||
}
|
|
||||||
fmt.Println(funcFoo.Call(params)[0])
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user