120 lines
2.4 KiB
Go
120 lines
2.4 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("12005640", []int64{2023417515})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestDelVipPrice(t *testing.T) {
|
|
err := api.DelVipPrice("667281", []*SkuIdEntity{
|
|
&SkuIdEntity{
|
|
OutSkuId: "31196",
|
|
},
|
|
})
|
|
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))
|
|
}
|
|
|
|
func TestUpdateVendorStationPrice(t *testing.T) {
|
|
result, err := api.UpdateVendorStationPrice("", "2", "", []*SkuPriceInfo{
|
|
&SkuPriceInfo{
|
|
OutSkuId: "02",
|
|
Price: 200,
|
|
},
|
|
&SkuPriceInfo{
|
|
OutSkuId: "01",
|
|
Price: 200,
|
|
},
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
|
}
|
|
|
|
func TestBatchUpdateCurrentQtys(t *testing.T) {
|
|
result, err := api.BatchUpdateCurrentQtys("", "2", "", []*SkuStock{
|
|
&SkuStock{
|
|
OutSkuId: "01",
|
|
StockQty: 111,
|
|
},
|
|
&SkuStock{
|
|
OutSkuId: "2212",
|
|
StockQty: 111,
|
|
},
|
|
}, "")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(result, false))
|
|
}
|