Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -144,6 +144,7 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
|||||||
}
|
}
|
||||||
signURL := a.genURL(cmd) + "?"
|
signURL := a.genURL(cmd) + "?"
|
||||||
params[signKey] = a.signParams(signURL, params)
|
params[signKey] = a.signParams(signURL, params)
|
||||||
|
//globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
var request *http.Request
|
var request *http.Request
|
||||||
@@ -224,6 +225,7 @@ func (a *API) AccessAPI3(cmd string, isGet bool, bizParams map[string]interface{
|
|||||||
params = utils.MergeMaps(params, bizParams)
|
params = utils.MergeMaps(params, bizParams)
|
||||||
signURL := a.genURL(cmd) + "?"
|
signURL := a.genURL(cmd) + "?"
|
||||||
params[signKey] = a.signParams(signURL, params)
|
params[signKey] = a.signParams(signURL, params)
|
||||||
|
//globals.SugarLogger.Debugf("params[signKey]=============%s", params[signKey])
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
var request *http.Request
|
var request *http.Request
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ func TestAa2(t *testing.T) {
|
|||||||
fmt.Println(api.signParams(apiURL+"/oauth/authorize?", map[string]interface{}{
|
fmt.Println(api.signParams(apiURL+"/oauth/authorize?", map[string]interface{}{
|
||||||
"timestamp": time,
|
"timestamp": time,
|
||||||
"app_id": "5873",
|
"app_id": "5873",
|
||||||
"app_poi_code": "5873_2705892",
|
"app_poi_code": "12422751",
|
||||||
"response_type": "token",
|
"response_type": "token",
|
||||||
}), time)
|
}), time)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import (
|
|||||||
warehouse_createFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/request"
|
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"
|
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/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -425,3 +426,22 @@ func TestUnBind(t *testing.T) {
|
|||||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||||
a.WarehouseUnbindStore([]int64{63114504}, "666667")
|
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})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user