- jd.GetSpuStatus added.
This commit is contained in:
@@ -90,3 +90,17 @@ func TestSupplierList(t *testing.T) {
|
|||||||
t.Log(utils.Format4Output(result, false))
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func init() {
|
|||||||
// sandbox
|
// sandbox
|
||||||
jdapi = New("c8854ef2-f80a-45ee-aceb-dc8014d646f8", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
|
jdapi = New("c8854ef2-f80a-45ee-aceb-dc8014d646f8", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
|
||||||
// prod
|
// prod
|
||||||
// jdapi = New("91633f2a-c5f5-4982-a925-a220d19095c3", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
// jdapi = New("ccb10daf-e6f5-4a58-ada5-b97f9073a137", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTest(t *testing.T) {
|
func TestTest(t *testing.T) {
|
||||||
|
|||||||
@@ -71,6 +71,12 @@ const (
|
|||||||
SkuFixedStatusDeleted = 4
|
SkuFixedStatusDeleted = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
CreateSpuResultSuccess = 1
|
||||||
|
CreateSpuResultInProgress = 2
|
||||||
|
CreateSpuResultFailed = 3
|
||||||
|
)
|
||||||
|
|
||||||
type SkuIDPair struct {
|
type SkuIDPair struct {
|
||||||
SkuId int64 `json:"skuId"`
|
SkuId int64 `json:"skuId"`
|
||||||
OutSkuId string `json:"outSkuId"`
|
OutSkuId string `json:"outSkuId"`
|
||||||
@@ -561,6 +567,16 @@ func (a *API) BatchAddSku(paramList []*CreateByUpcParam) (pairs []*CreateByUpcPa
|
|||||||
return nil, err
|
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) {
|
func interface2Cat(data interface{}, level int) (cat *CategoryInfo) {
|
||||||
|
|||||||
@@ -165,3 +165,11 @@ func TestBatchAddSku(t *testing.T) {
|
|||||||
}
|
}
|
||||||
t.Log(utils.Format4Output(result, false))
|
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))
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user