1
This commit is contained in:
@@ -48,7 +48,7 @@ type ProductDetailParam struct {
|
||||
// 商品ID,抖店系统生成,店铺下唯一;长度19位。
|
||||
ProductId string `json:"product_id"`
|
||||
// 外部商家编码,商家自定义字段
|
||||
OutProductId string `json:"out_product_id"`
|
||||
// true:读取草稿数据;false:读取线上数据;不传默认为false
|
||||
ShowDraft string `json:"show_draft"`
|
||||
//OutProductId string `json:"out_product_id"`
|
||||
//// true:读取草稿数据;false:读取线上数据;不传默认为false
|
||||
//ShowDraft string `json:"show_draft"`
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ func (a *API) GetSkuDetail(productId, outProductId string) (*product_detail_resp
|
||||
param.ProductId = productId
|
||||
}
|
||||
if outProductId != "" {
|
||||
param.OutProductId = outProductId
|
||||
//param.OutProductId = outProductId
|
||||
}
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
|
||||
@@ -5,6 +5,8 @@ import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
product_addV2_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request"
|
||||
sku_editPrice_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_editPrice/request"
|
||||
sku_syncStock_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_syncStock/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"go.uber.org/zap"
|
||||
@@ -220,7 +222,35 @@ func TestGetSkuDetail(t *testing.T) {
|
||||
token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}`
|
||||
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
data, err := a.GetSkuDetail("3574180746237226525", "")
|
||||
data, err := a.GetSkuDetail("3576377564144516403", "")
|
||||
fmt.Println(err)
|
||||
globals.SugarLogger.Debugf("====%s", utils.Format4Output(data, false))
|
||||
}
|
||||
|
||||
func TestUpdateSkuStore(t *testing.T) {
|
||||
token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
err := a.UpdateSkuStock(&sku_syncStock_request.SkuSyncStockParam{
|
||||
SkuId: 1746278107578416,
|
||||
ProductId: 3576377564144516403,
|
||||
//OutProductId: 8076827,
|
||||
Incremental: false,
|
||||
IdempotentId: "",
|
||||
StockNum: 100,
|
||||
})
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
func TestEiduPrice(t *testing.T) {
|
||||
token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
err := a.EditPrice(&sku_editPrice_request.SkuEditPriceParam{
|
||||
Price: 500,
|
||||
//Code: "",
|
||||
SkuId: 1746278107578416,
|
||||
//OutSkuId: 0,
|
||||
ProductId: 3576377564144516403,
|
||||
//OutProductId: 0,
|
||||
})
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user