This commit is contained in:
邹宗楠
2022-12-21 17:04:37 +08:00
parent 7b4099daac
commit 35ddeed751
3 changed files with 27 additions and 12 deletions

View File

@@ -18,7 +18,8 @@ import (
// "authority_id": ""
//}`
var token = `{"access_token":"e8b6c1bc-2477-40ff-bd8e-faf547669d77","expires_in":1671431173,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"3cd84170-73a0-485c-b55a-74e128618693","authority_id":""}`
//var token = `{"access_token":"e8b6c1bc-2477-40ff-bd8e-faf547669d77","expires_in":1671431173,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"3cd84170-73a0-485c-b55a-74e128618693","authority_id":""}`
var token = `{"access_token":"83e52462-ad46-4297-98c4-242ee6b7a5c8","expires_in":1672033612,"scope":"SCOPE","shop_id":63141688,"shop_name":"二期-抖音超市小时达测试店铺","refresh_token":"8f690bc3-3f3e-49bd-bbf7-31c9e868e980","authority_id":""}`
var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
// 查询售后单详情

View File

@@ -222,6 +222,8 @@ func (a *API) GetSkuDetail(productId, outProductId string) (*product_detail_resp
}
result, err := request.Execute(a.accessTokenObj)
globals.SugarLogger.Debugf("=GetSkuDetail By productId %s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("=GetSkuDetail By err %s", utils.Format4Output(err, false))
if err != nil {
return nil, err
}
@@ -241,6 +243,8 @@ func (a *API) GetSkuDetailLocalID(productId, outProductId string) (*product_deta
}
result, err := request.Execute(a.accessTokenObj)
globals.SugarLogger.Debugf("=GetSkuDetail By productId %s", utils.Format4Output(result, false))
globals.SugarLogger.Debugf("=GetSkuDetail By err %s", utils.Format4Output(err, false))
if err != nil {
return nil, err
}

View File

@@ -224,7 +224,7 @@ func TestInt16(t *testing.T) {
// 查询商品详情(抖音平台id)
func TestGetSkuDetail(t *testing.T) {
data, err := a.GetSkuDetailLocalID("", "30204")
data, err := a.GetSkuDetailLocalID("", "6099286")
fmt.Println(err)
// 3582171870197365727 3582171870197365727
globals.SugarLogger.Debugf("====%s", utils.Format4Output(data, false))
@@ -270,16 +270,26 @@ func TestEiduPrice(t *testing.T) {
// s上架1
func TestEditStoreCommodity(t *testing.T) {
data, _ := a.GetSkuDetail("3580251132888538614", "")
globals.SugarLogger.Debugf("=============%s", data.ProductFormatNew)
specPrice, _ := json.Marshal(data.SpecPrices)
a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{
ProductId: 1748169491056643,
ProductFormatNew: data.ProductFormatNew,
SpecPrices: string(specPrice),
Specs: "重量|250g",
Commit: true,
})
err := a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{
CategoryLeafId: 22428,
Name: "净芹菜约350g/份(净菜芹菜摘叶洗净,保鲜膜包装)",
Pic: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/PTWpUjYg_m_78dbc86c51be55406cd2f51bc863b2e0_sx_32178_www800-800",
Description: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/PTWpUjYg_m_4fdaab3dd1df6ed4aa8d0990b0e99ee7_sx_456574_www750-3527",
PayType: 1,
ReduceType: 2,
Weight: 350,
WeightUnit: 1,
DeliveryDelayDay: 9999,
Mobile: "18048531223",
Commit: true,
Specs: "重量|350g",
SpecPrices: "[{\"spec_detail_name1\":\"350g\",\"spec_detail_name2\":\"\",\"spec_detail_name3\":\"\",\"stock_num\":9999,\"price\":850,\"code\":\"23010\",\"step_stock_num\":0,\"supplier_id\":\"\",\"outer_sku_id\":\"23010\",\"sku_type\":1,\"stock_num_map\":{\"79226307\":9999},\"delivery_infos\":[{\"info_type\":\"weight\",\"info_value\":\"350\",\"info_unit\":\"g\"}]}]",
ProductFormatNew: "{\n\t\"1687\": [\n\t\t{\n\t\t\t\"diy_type\": 0,\n\t\t\t\"name\": \"品牌\",\n\t\t\t\"value\": 789194134\n\t\t}\n\t]\n}",
StandardBrandId: 789194134,
NeedCheckOut: false,
ForceUseQualityList: false,
NeedRechargeMode: false})
t.Fatal(err)
}
// 上架2