- 在jd.getStoreSkusBareInfoLimitSize设置Stock
This commit is contained in:
@@ -3,6 +3,7 @@ package jd
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/putils"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -12,11 +13,11 @@ import (
|
||||
func TestGetStoreSkusBareInfo(t *testing.T) {
|
||||
// list := []*partner.StoreSkuInfo{
|
||||
// &partner.StoreSkuInfo{
|
||||
// SkuID: 5246,
|
||||
// VendorSkuID: "2023747677",
|
||||
// SkuID: 2212,
|
||||
// VendorSkuID: "2019458103",
|
||||
// },
|
||||
// }
|
||||
// for i := 0; i < 3000; i++ {
|
||||
// for i := 0; i < 30-1; i++ {
|
||||
// list = append(list, list[0])
|
||||
// }
|
||||
skuNameList, err := curPurchaseHandler.GetSkus(jxcontext.AdminCtx, 0, "", "")
|
||||
@@ -24,10 +25,17 @@ func TestGetStoreSkusBareInfo(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
list := putils.StoreSkuFullList2Bare(skuNameList)
|
||||
|
||||
storeSkuList, err := curPurchaseHandler.GetStoreSkusBareInfo(jxcontext.AdminCtx, nil, 2, "11053496", list)
|
||||
if err != nil {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
t.Log(utils.Format4Output(storeSkuList, false))
|
||||
t.Log(len(storeSkuList))
|
||||
var focusedStoreSkuList []*partner.StoreSkuInfo
|
||||
for _, v := range storeSkuList {
|
||||
if v.Stock > 0 {
|
||||
focusedStoreSkuList = append(focusedStoreSkuList, v)
|
||||
}
|
||||
}
|
||||
t.Log(utils.Format4Output(focusedStoreSkuList, false))
|
||||
t.Log(len(focusedStoreSkuList))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user