- ebai key changed.

This commit is contained in:
gazebo
2018-10-08 08:25:34 +08:00
parent 58b6d6329d
commit 00cbc8f635
4 changed files with 27 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ import (
)
const (
testShopBaiduID = 2233043816
testShopBaiduID = 2233909607
testShopID = "100077"
)
@@ -27,7 +27,7 @@ func init() {
baseapi.Init(sugarLogger)
// sandbox
api = New("63032", "8c8b66720b69ae85")
api = New("62923", "aa4cdc6c1108486b")
// prod
// api = New("source", "secret")
}

View File

@@ -7,10 +7,24 @@ import (
)
func TestOrderGet(t *testing.T) {
result, err := api.OrderGet("15380342248732")
result, err := api.OrderGet("15381031350154")
if err != nil {
t.Fatal(err)
} else {
t.Log(utils.Format4Output(result, false))
}
}
func TestOrderCallDelivery(t *testing.T) {
err := api.OrderCallDelivery("15381031350154")
if err != nil {
t.Fatal(err)
}
}
func TestOrderSendOut(t *testing.T) {
err := api.OrderSendOut("15381031350154", "")
if err != nil {
t.Fatal(err)
}
}

View File

@@ -117,12 +117,11 @@ func (a *API) SkuCreate(shopID string, customSkuID int, params map[string]interf
KeyShopID: shopID,
"custom_sku_id": customSkuID,
"upc_type": UPCTypePrivate,
"upc": customSkuID,
"brand_name": "无", // 很狗血的是,你还必须填个无才行。。。
}
// if params["upc"] == nil {
// defParams["upc"] = "upc-" + utils.Int2Str(customSkuID)
// }
if params["upc"] == nil {
defParams["upc"] = "upc-" + utils.Int2Str(customSkuID)
}
if params["brand_id"] == nil {
defParams["brand_id"] = 0
}

View File

@@ -32,14 +32,14 @@ func TestShopCategoryUpdate(t *testing.T) {
}
func TestShopCategoryDelete(t *testing.T) {
err := api.ShopCategoryDelete(testShopID, 153760292217132)
err := api.ShopCategoryDelete(testShopID, 1538315352106929)
if err != nil {
t.Fatal(err)
}
}
func TestSkuGetItemsByCategoryId(t *testing.T) {
result, err := api.SkuGetItemsByCategoryId(testShopID, 0)
result, err := api.SkuGetItemsByCategoryId(testShopID, 153838813210900)
if err != nil {
t.Fatal(err)
} else {
@@ -48,7 +48,10 @@ func TestSkuGetItemsByCategoryId(t *testing.T) {
}
func TestSkuList(t *testing.T) {
result, err := api.SkuList(testShopID, nil)
result, err := api.SkuList(testShopID, map[string]interface{}{
// "sku_id": 15381031761764456,
// "delete": 1,
})
if err != nil {
t.Fatal(err)
} else {
@@ -57,7 +60,7 @@ func TestSkuList(t *testing.T) {
}
func TestSkuCreate(t *testing.T) {
result, err := api.SkuCreate(testShopID, 116, map[string]interface{}{
result, err := api.SkuCreate(testShopID, 10, map[string]interface{}{
"name": "测试商品",
"status": SkuStatusOnline,
"left_num": MaxLeftNum,