This commit is contained in:
richboo111
2022-11-18 15:19:19 +08:00
parent 616ce33257
commit dc5c04fa4a
2 changed files with 22 additions and 3 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"crypto/md5"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"mime/multipart"
"net/http"
"net/url"
@@ -145,7 +144,7 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
}
signURL := a.genURL(cmd) + "?"
params[signKey] = a.signParams(signURL, params)
globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
//globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request {
var request *http.Request
@@ -226,7 +225,7 @@ func (a *API) AccessAPI3(cmd string, isGet bool, bizParams map[string]interface{
params = utils.MergeMaps(params, bizParams)
signURL := a.genURL(cmd) + "?"
params[signKey] = a.signParams(signURL, params)
globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
//globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request {
var request *http.Request

View File

@@ -19,6 +19,7 @@ import (
warehouse_createFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/request"
warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals"
"math/rand"
"strconv"
"strings"
@@ -425,3 +426,22 @@ func TestUnBind(t *testing.T) {
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
a.WarehouseUnbindStore([]int64{63114504}, "666667")
}
func TestTime(t *testing.T) {
fmt.Println(BatchStr2Time("2022-10-31", "2022-11-06"))
}
func BatchStr2Time(strTime ...string) (timeList []time.Time, err error) {
timeList = make([]time.Time, len(strTime))
for k, v := range strTime {
if v == "" {
timeList[k] = utils.DefaultTimeValue
} else {
if timeList[k], err = utils.TryStr2Time(v); err != nil {
return nil, err
}
}
}
return timeList, nil
}
func TestPrint(t *testing.T) {
globals.SugarLogger.Debugf("%d", []int{1, 2, 3, 46, 65})
}