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

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