This commit is contained in:
邹宗楠
2021-12-14 10:10:32 +08:00
parent 18126f6b73
commit a2fa9bf427
2 changed files with 21 additions and 14 deletions

View File

@@ -51,12 +51,12 @@ type SkuListParams struct {
Upc string `json:"upc,omitempty"`
SkuID int64 `json:"sku_id,omitempty"`
CustomSkuID string `json:"custom_sku_id,omitempty"`
UpcType int `json:"upc_type,omitempty"`
GetUncate int `json:"get_uncate,omitempty"`
Delete int `json:"delete,omitempty"`
Enabled int `json:"enabled,omitempty"`
StartTime int `json:"start_time,omitempty"`
EndTime int `json:"end_time,omitempty"`
//UpcType int `json:"upc_type,omitempty"`
GetUncate int `json:"get_uncate,omitempty"`
Delete int `json:"delete,omitempty"`
Enabled int `json:"enabled,omitempty"`
StartTime int `json:"start_time,omitempty"`
EndTime int `json:"end_time,omitempty"`
}
type SkuPhotoInfo struct {
@@ -92,10 +92,10 @@ type SkuInfo struct {
ShelfNumber string `json:"shelf_number"`
SkuID int64 `json:"sku_id"`
// SkuProperty []interface{} `json:"sku_property"`
Status int `json:"status"`
Summary string `json:"summary"`
Upc string `json:"upc"`
UpcType string `json:"upc_type"`
Status int `json:"status"`
Summary string `json:"summary"`
Upc string `json:"upc"`
//UpcType string `json:"upc_type"`
UpdateTime string `json:"update_time"`
Weight int `json:"weight"`
WeightFlag int `json:"weight_flag"`
@@ -294,14 +294,14 @@ 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) {
func (a *API) SkuCreate(trackInfo, shopID string, customSkuID string, params map[string]interface{}) (skuID int64, err error) {
defParams := map[string]interface{}{
KeyShopID: shopID,
KeyCustomSkuID: customSkuID,
}
if params["upc"] == nil {
defParams["upc_type"] = UPCTypePrivate
defParams["upc"] = "upc-" + utils.Int2Str(int(customSkuID))
// defParams["upc_type"] = UPCTypePrivate
defParams["upc"] = "upc-" + "customSkuID"
}
/*if params["brand_id"] == nil {
defParams["brand_id"] = 0

View File

@@ -76,9 +76,16 @@ func TestSkuCreate(t *testing.T) {
"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": true,
"is_master": 1,
"url": "http://image.jxc4.com/8536c76779333f53517006f88ea7174c.jpg?imageView2/1/w/80/h/80",
},
},