京东商品

This commit is contained in:
苏尹岚
2020-06-09 18:58:04 +08:00
parent 762a41dbdd
commit 73b0253721
5 changed files with 321 additions and 8 deletions

View File

@@ -231,7 +231,7 @@ func TestFindVendorCategories(t *testing.T) {
}
func TestFindAttrs(t *testing.T) {
result, err := api.FindAttrs(13582)
result, err := api.FindAttrs(15245)
if err != nil {
t.Fatal(err)
}
@@ -239,7 +239,7 @@ func TestFindAttrs(t *testing.T) {
}
func TestFindValuesByAttrId(t *testing.T) {
result, no, err := api.FindValuesByAttrId(150390)
result, no, err := api.FindValuesByAttrId(1001038262)
if err != nil {
t.Fatal(err)
}
@@ -368,7 +368,7 @@ func TestDeleteSku(t *testing.T) {
}
func TestFindSkuById(t *testing.T) {
result, err := api.FindSkuById(69576828876)
result, err := api.FindSkuById(69948250090)
if err != nil {
t.Fatal(err)
}
@@ -427,3 +427,162 @@ func TestTransparentImageAdd(t *testing.T) {
// suffix := str[12:len(str)]
fmt.Println(str[:12])
}
func TestUpdateWareSaleAttrvalueAlias(t *testing.T) {
err := api.UpdateWareSaleAttrvalueAlias(&UpdateWareSaleAttrvalueAliasParam{
WareID: 14566414324,
Props: []*CreateSkuParamAttrs2{
&CreateSkuParamAttrs2{
AttrID: "1001038262",
AttrValues: []string{"2453826609"},
AttrValueAlias: []string{"500g 下午易缺货"},
Type: "com.jd.pop.ware.ic.api.domain.prop",
Type2: "com.jd.pop.ware.ic.api.domain.Prop",
},
},
})
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestSearchSkuList(t *testing.T) {
var wareIDs = []int64{
14518860227,
14518865342,
14518857791,
14518863440,
14518850181,
14518869426,
14518865836,
14518860282,
14518862865,
14518860089,
14518861773,
14518857091,
14518859794,
14518878413,
14518874243,
14518992990,
14519010404,
14519010010,
14519006838,
14519009822,
14541114008,
14542371664,
14542409106,
14542477967,
14542585438,
14542602011,
14542586377,
14542927723,
14542946611,
14542948535,
14543031285,
14543077206,
14544951705,
14546014638,
14565258994,
14565275855,
14566133342,
14566144059,
14566419305,
14566403990,
14566408956,
14567187277,
14567793468,
14567911336,
14567910034,
14567907049,
14567904981,
14567909664,
14567907786,
14568001774,
14568152611,
14568138877,
14568146252,
14568161923,
14568508881,
14568512475,
14568524772,
14568533264,
14568540322,
14568534834,
14568546936,
14568542882,
14568806841,
14576405495,
14576832607,
14576832017,
14576946037,
14576974106,
14576993226,
14579143223,
14581769973,
14581773059,
14581773646,
14581780520,
14581782920,
14581768094,
14581788365,
14581805504,
14581919920,
14581915051,
14581920950,
14581971709,
14581979302,
14581974927,
14581974739,
14581964099,
14581974639,
14581976637,
14581979946,
14581989815,
14581987337,
14581987251,
14581981273,
14581996123,
14581984285,
14581994544,
14581996576,
14582006319,
14582000952,
14582000668,
14581993998,
14581996999,
14582016736,
14582053303,
14594027838,
14594055255,
14594104816,
14594233747,
14594245738,
14594249079,
14594296303,
14594987858,
14596828148,
14600091528,
14600094614,
14600087648,
14566414324}
for _, v := range wareIDs {
result, _ := api.SearchSkuList(v)
for _, vv := range result {
api.DeleteSku(vv.SkuID)
}
}
// result, err := api.SearchSkuList(14518857091)
// if err != nil {
// t.Fatal(err)
// }
// t.Log(utils.Format4Output(result, false))
}
func TestAAAAAA(t *testing.T) {
result, err := api.SearchSkuList(14518860227)
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}