From 822bda90e0c6a669349fc94a65e7420e1737be2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 8 Apr 2024 08:55:49 +0800 Subject: [PATCH] 1 --- platformapi/jdapi/order_test.go | 28 +++++++++++++++++++++-- platformapi/tiktok_shop/tiktok_api/sku.go | 5 ++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/platformapi/jdapi/order_test.go b/platformapi/jdapi/order_test.go index 71bedd89..4a7ef86a 100644 --- a/platformapi/jdapi/order_test.go +++ b/platformapi/jdapi/order_test.go @@ -3,6 +3,9 @@ package jdapi import ( "fmt" "git.rosy.net.cn/baseapi/utils" + "io/ioutil" + "net/http" + "strings" "testing" ) @@ -29,8 +32,7 @@ func TestPickUp(t *testing.T) { func TestOrderQuery(t *testing.T) { jdParams := map[string]interface{}{ - "deliveryStationNo": "11954632", - "orderPurchaseTime_begin": "2022-11-05 00:00:00", + "orderId": "2408169643015823", } result, totalCount, err := api.OrderQuery(jdParams) if err != nil { @@ -227,3 +229,25 @@ func TestAfsOpenApprove(t *testing.T) { t.Fatal(err.Error()) } } + +func TestUpdateBoxFee(t *testing.T) { + url := "http://www.jxc4.com/v2/sku/BatchSetBoxPrice" + storeIds := []int{ + 668545, 668548, 668567, 668568, 668577, 668580, 668583, 668599, 668601, 668607, 668614, 668617, 668620, + 668622, 668623, 668624, 668631, 668639, 668642, 668650, 668651, 668659, 668665, 668668, 668681, 668682, 668686, 668700, 668701, + 668746, 668757, 668759, 668766, 668767, 668772, 668773, 668795, 668815, 668838, 668839, 668843, 668849, 668850, 668851, 668853, + 668860, 668868, 668878, 668882, 668886, 668891, 668894, 668897, 668900, 668905, 668906, 668908, 668909, 668910, 668915, 668922, + } + for _, v := range storeIds { + payload := strings.NewReader(fmt.Sprintf("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeIDs\"\r\n\r\n[%d]\r\n-----011000010111000001101001--\r\n\r\n", v)) + req, _ := http.NewRequest("POST", url, payload) + req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001") + res, _ := http.DefaultClient.Do(req) + defer res.Body.Close() + body, _ := ioutil.ReadAll(res.Body) + fmt.Println(v) + fmt.Println(res) + fmt.Println(string(body)) + } + +} diff --git a/platformapi/tiktok_shop/tiktok_api/sku.go b/platformapi/tiktok_shop/tiktok_api/sku.go index 2c800375..d34cce8d 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku.go +++ b/platformapi/tiktok_shop/tiktok_api/sku.go @@ -34,6 +34,7 @@ import ( superm_product_createSubProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_createSubProduct/request" superm_product_launchProduct_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_product_launchProduct/request" "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" "io/ioutil" "net/http" "strings" @@ -694,6 +695,10 @@ func (a *API) CreateSubProduct(mainProductId int64, storeId int64) (int64, error request.Param.StoreId = storeId result, err := request.Execute(a.accessTokenObj) + + globals.SugarLogger.Debugf("=====param := %s", utils.Format4Output(request.Param, false)) + globals.SugarLogger.Debugf("=====result := %s", utils.Format4Output(result, false)) + globals.SugarLogger.Debugf("=====param := %v", err) if err != nil { return 0, err }