diff --git a/platformapi/ebaiapi/shop_sku_test.go b/platformapi/ebaiapi/shop_sku_test.go index 1456b210..7cbd2fbc 100644 --- a/platformapi/ebaiapi/shop_sku_test.go +++ b/platformapi/ebaiapi/shop_sku_test.go @@ -53,16 +53,27 @@ func TestSkuGetItemsByCategoryId(t *testing.T) { } func TestSkuList(t *testing.T) { - result, err := api.SkuList("100829", &SkuListParams{ - Page: 1, - PageSize: 100, - SkuIdOffset: 0, - }) - if err != nil { - t.Fatal(err) - } else { - t.Log(utils.Format4Output(result, false)) + foodListData := make([]*SkuInfo, 0, 0) + skuIdOffset := 0 + + for { + param := &SkuListParams{ + Page: 1, + PageSize: 100, + SkuIdOffset: skuIdOffset, + } + foodList, err := api.SkuList(utils.Int2Str(100829), param) + if err != nil { + break + } + + foodListData = append(foodListData, foodList.List...) + if len(foodList.List) < 100 { + break + } + skuIdOffset = foodList.SkuIdOffset } + } func TestSkuUploadRTF(t *testing.T) {