This commit is contained in:
邹宗楠
2024-04-08 08:55:49 +08:00
parent edfb4032d4
commit 822bda90e0
2 changed files with 31 additions and 2 deletions

View File

@@ -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))
}
}

View File

@@ -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
}