京东商城刷新待售商品
This commit is contained in:
@@ -33,6 +33,21 @@ const (
|
|||||||
JxBrandId = 559853
|
JxBrandId = 559853
|
||||||
JdShopMaxStock = 9999
|
JdShopMaxStock = 9999
|
||||||
JdsPromiseID = 13725637
|
JdsPromiseID = 13725637
|
||||||
|
|
||||||
|
JdsSkuStatus1 = 1 //从未上架
|
||||||
|
JdsSkuStatus2 = 2 //自主下架
|
||||||
|
JdsSkuStatus4 = 4 //系统下架
|
||||||
|
JdsSkuStatus8 = 8 //在售
|
||||||
|
JdsSkuStatus513 = 513 //从未上架 待审核
|
||||||
|
JdsSkuStatus514 = 514 //自主下架 待审核
|
||||||
|
JdsSkuStatus516 = 516 //系统下架 待审核
|
||||||
|
JdsSkuStatus520 = 520 //在售 待审核
|
||||||
|
JdsSkuStatus1025 = 1025 //从未上架 审核不通过 暂时没用
|
||||||
|
JdsSkuStatus1026 = 1026 //自主下架 审核不通过 暂时没用
|
||||||
|
JdsSkuStatus1028 = 1028 //系统下架 审核不通过
|
||||||
|
JdsSkuStatus1032 = 1032 //在售 审核不通过
|
||||||
|
|
||||||
|
PassReason = "审核通过"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -548,9 +548,12 @@ func (a *API) UpdateWareMarketPrice(wareId int64, marketPrice float64) (err erro
|
|||||||
|
|
||||||
//获取商品下架原因
|
//获取商品下架原因
|
||||||
//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1225&apiName=jingdong.ware.read.findOpReason
|
//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1225&apiName=jingdong.ware.read.findOpReason
|
||||||
func (a *API) FindOpReason(wareId int64) (err error) {
|
func (a *API) FindOpReason(wareId int64) (reason string, err error) {
|
||||||
_, err = a.AccessAPI2("jingdong.ware.read.findOpReason", prodURL, map[string]interface{}{
|
result, err := a.AccessAPI2("jingdong.ware.read.findOpReason", prodURL, map[string]interface{}{
|
||||||
"wareId": wareId,
|
"wareId": wareId,
|
||||||
})
|
})
|
||||||
return err
|
if err == nil {
|
||||||
|
reason = result["jingdong_ware_read_findOpReason_responce"].(map[string]interface{})["opReason"].(map[string]interface{})["note"].(string)
|
||||||
|
}
|
||||||
|
return reason, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,9 +378,9 @@ func TestUpdateWareMarketPrice(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFindOpReason(t *testing.T) {
|
func TestFindOpReason(t *testing.T) {
|
||||||
err := api.FindOpReason(14519009105)
|
result, err := api.FindOpReason(14519009105)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
// t.Log(utils.Format4Output(result, false))
|
t.Log(utils.Format4Output(result, false))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
|||||||
if jsonResult1 == nil {
|
if jsonResult1 == nil {
|
||||||
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil")
|
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil")
|
||||||
}
|
}
|
||||||
|
if strings.Contains(bodyStr, "登录") {
|
||||||
|
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("cookie可能过期了!")
|
||||||
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if jsonResult1["error_response"] != nil {
|
if jsonResult1["error_response"] != nil {
|
||||||
errLevel = platformapi.ErrLevelGeneralFail
|
errLevel = platformapi.ErrLevelGeneralFail
|
||||||
|
|||||||
Reference in New Issue
Block a user