- jd.GetSpuStatus added.

This commit is contained in:
gazebo
2019-01-02 15:46:40 +08:00
parent 4e0adf45d0
commit 2d525ea749
4 changed files with 39 additions and 1 deletions

View File

@@ -90,3 +90,17 @@ func TestSupplierList(t *testing.T) {
t.Log(utils.Format4Output(result, false))
}
}
func TestShopOnline(t *testing.T) {
err := api.ShopOnline("", testShopBaiduID)
if err != nil {
t.Fatal(err)
}
}
func TestShopOffline(t *testing.T) {
err := api.ShopOffline("", testShopBaiduID)
if err != nil {
t.Fatal(err)
}
}

View File

@@ -23,7 +23,7 @@ func init() {
// sandbox
jdapi = New("c8854ef2-f80a-45ee-aceb-dc8014d646f8", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
// prod
// jdapi = New("91633f2a-c5f5-4982-a925-a220d19095c3", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
// jdapi = New("ccb10daf-e6f5-4a58-ada5-b97f9073a137", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
}
func TestTest(t *testing.T) {

View File

@@ -71,6 +71,12 @@ const (
SkuFixedStatusDeleted = 4
)
const (
CreateSpuResultSuccess = 1
CreateSpuResultInProgress = 2
CreateSpuResultFailed = 3
)
type SkuIDPair struct {
SkuId int64 `json:"skuId"`
OutSkuId string `json:"outSkuId"`
@@ -561,6 +567,16 @@ func (a *API) BatchAddSku(paramList []*CreateByUpcParam) (pairs []*CreateByUpcPa
return nil, err
}
func (a *API) GetSpuStatus(outSpuId string) (resultStatus int, err error) {
result, err := a.AccessAPINoPage("pms/getSpuStatus", map[string]interface{}{
"outSuperId": outSpuId,
}, nil, nil, nil)
if err == nil {
return int(utils.MustInterface2Int64(result.(map[string]interface{})["status"])), nil
}
return 0, err
}
///////////////////////////
// 私有辅助函数
func interface2Cat(data interface{}, level int) (cat *CategoryInfo) {

View File

@@ -165,3 +165,11 @@ func TestBatchAddSku(t *testing.T) {
}
t.Log(utils.Format4Output(result, false))
}
func TestGetSpuStatus(t *testing.T) {
result, err := jdapi.GetSpuStatus("8515")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}