74 lines
1.5 KiB
Go
74 lines
1.5 KiB
Go
package jdapi
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
const (
|
|
mustExistSkuID = 2023747677
|
|
mustExistSkuJXID = "5246"
|
|
)
|
|
|
|
func TestGetStationInfoList(t *testing.T) {
|
|
result, err := api.GetStationInfoList(mustExistStoreID, []int64{mustExistSkuID})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestQueryOpenUseable(t *testing.T) {
|
|
result, err := api.QueryOpenUseable([]*BaseStockCenterRequest{
|
|
&BaseStockCenterRequest{
|
|
StationNo: mustExistStoreID,
|
|
SkuId: mustExistSkuID,
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestQueryStockCenter(t *testing.T) {
|
|
result, err := api.QueryStockCenter(mustExistStoreJXID, []*SkuIdEntity{
|
|
&SkuIdEntity{
|
|
OutSkuId: mustExistSkuJXID,
|
|
},
|
|
}, "test")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestBatchUpdateVendibility(t *testing.T) {
|
|
result, err := api.BatchUpdateVendibility("", "100130", "", []*StockVendibility{
|
|
&StockVendibility{
|
|
OutSkuId: "26919",
|
|
DoSale: true,
|
|
},
|
|
}, "test")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestUpdateVendibility(t *testing.T) {
|
|
result, err := api.UpdateVendibility("", []*QueryStockRequest{
|
|
&QueryStockRequest{
|
|
StationNo: "11053496",
|
|
SkuId: 2012224772,
|
|
DoSale: 1,
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
|
}
|