This commit is contained in:
邹宗楠
2024-01-26 16:25:09 +08:00
parent 72884192af
commit 8cef64a577
2 changed files with 17 additions and 27 deletions

View File

@@ -2,7 +2,6 @@ package ebaiapi
import (
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"regexp"
"strings"
@@ -322,10 +321,6 @@ func (a *API) SkuList(shopID string, params *SkuListParams) (skuInfo *PageDataIn
// 饿百商品名可以相同,不会报错
func (a *API) SkuCreate(trackInfo, shopID string, customSkuID int64, params map[string]interface{}) (skuID int64, err error) {
globals.SugarLogger.Debugf("======== %s", trackInfo)
globals.SugarLogger.Debugf("======== %s", shopID)
globals.SugarLogger.Debugf("======== %d", customSkuID)
globals.SugarLogger.Debugf("======== %s", utils.Format4Output(params, false))
defParams := map[string]interface{}{
KeyShopID: shopID,
KeyCustomSkuID: customSkuID,

View File

@@ -72,28 +72,23 @@ func TestSkuUploadRTF(t *testing.T) {
}
func TestSkuCreate(t *testing.T) {
result, err := api.SkuCreate("", testShopID, 17, map[string]interface{}{
"name": "测试商品",
"status": SkuStatusOnline,
"left_num": MaxLeftNum,
"sale_price": 100,
"market_price": 100,
"cat1_id": 151301831158987,
"cat2_id": 15347484581335,
"cat3_id": 15347484581339,
"encrypt": "",
"sign": "A97439C8B502BB7197EC7E5CED53C158",
"source": "34665",
"ticket": "E700820C-8FDC-4A8B-A920-38ACAA01C332",
"timestamp": 1639390432,
"traceid": "0bc5f41d16393904320001232e5843",
"version": "3",
"photos": []map[string]interface{}{
map[string]interface{}{
"is_master": 1,
"url": "http://image.jxc4.com/8536c76779333f53517006f88ea7174c.jpg?imageView2/1/w/80/h/80",
},
},
result, err := api.SkuCreate("DD1445C6BC2011EEB00C525400E86DC0", "800437", 20240085, map[string]interface{}{
"cat3_id": 201218221,
"category_id": 201217436,
"left_num": 9999,
"minimum": 1,
"name": "【新品上市】新鲜 洗净智利进口车厘子 500gJJ",
"photos": map[string]interface{}{
"is_master": 1,
"url": "https://img.alicdn.com/imgextra/i4/1/O1CN011UdvjE1BsVJlGQ4ok_!!1-0-tcretail.jpg"},
"preparation_time": 0,
"process_type": 0,
"rtf": "https://img.alicdn.com/imgextra/desc/icoss!0764993629621!13916222277",
"sale_price": 13200,
"seven_days_no_reason": false,
"status": "1",
"upc": "3004279768217",
"weight": "500",
})
if err != nil {
t.Fatal(err)