diff --git a/platformapi/jdshopapi/sku.go b/platformapi/jdshopapi/sku.go index f1942cc0..88af991d 100644 --- a/platformapi/jdshopapi/sku.go +++ b/platformapi/jdshopapi/sku.go @@ -399,7 +399,7 @@ func (a *API) UpdateSkuStock(skuId, stockNum int) (err error) { //https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1253&apiName=jingdong.price.write.updateSkuJdPrice //单位为元 func (a *API) UpdateSkuJdPrice(skuId int, jdPrice float64) (err error) { - _, err = a.AccessAPI2("jingdong.price.write.updateSkuJdPrice", prodURL, map[string]interface{}{ + _, err = a.AccessAPI("jingdong.price.write.updateSkuJdPrice", prodURL, map[string]interface{}{ "skuId": skuId, "jdPrice": jdPrice, }) diff --git a/platformapi/jdshopapi/sku_test.go b/platformapi/jdshopapi/sku_test.go index 5f59d8ef..37810ad2 100644 --- a/platformapi/jdshopapi/sku_test.go +++ b/platformapi/jdshopapi/sku_test.go @@ -454,19 +454,12 @@ func TestUpdateWareSaleAttrvalueAlias(t *testing.T) { } func TestSearchSkuList(t *testing.T) { - var rr []int64 - ser, _ := api.SearchWare4Valid("", 1, 100) - for _, v := range ser.Data { - result, _ := api.SearchSkuList(v.WareID) - for _, vv := range result { - result2, _ := api.FindSkuById(vv.SkuID) - _, _, _, specUnit, _, specQuality := SplitSkuName(result2.SaleAttrs[0].AttrValueAlias[0]) - if specQuality < 100 && specUnit != "kg" && specUnit != "L" { - rr = append(rr, vv.SkuID) - } - } + var jdsIDs = []int64{ + 70360362787, 70360943788, 70360811895, 70360582829, 70360415481, 70360967221, 70360686708, 70360712729, 70360775271, + } + for _, v := range jdsIDs { + api.DeleteSku(v) } - fmt.Println("test", rr) // result, err := api.SearchSkuList(14518857091) // if err != nil { // t.Fatal(err) @@ -516,3 +509,11 @@ func SplitSkuName(skuName string) (prefix, name, comment, specUnit, unit string, } return prefix, name, comment, specUnit, unit, specQuality } + +func TestUpdateSkuJdPrice(t *testing.T) { + err := api.UpdateSkuJdPrice(7038506664, 10) + if err != nil { + t.Fatal(err) + } + // t.Log(utils.Format4Output(result, false)) +}