diff --git a/platformapi/tiktok_shop/tiktok_api/transport_test.go b/platformapi/tiktok_shop/tiktok_api/transport_test.go index a1490775..201c4089 100644 --- a/platformapi/tiktok_shop/tiktok_api/transport_test.go +++ b/platformapi/tiktok_shop/tiktok_api/transport_test.go @@ -2,6 +2,7 @@ package tiktok_api import ( "fmt" + "git.rosy.net.cn/baseapi/utils" "testing" ) @@ -15,3 +16,21 @@ func TestCancelWaybill(t *testing.T) { err := a.ShopOrderDispatcher(62490423, "5017358149445080799", 2) fmt.Println(err) } +func Test(t *testing.T) { + a := make([]int64, 0) + Strings2Objs(`[1262627,1723872383]`, &a) + fmt.Println(a) +} +func Strings2Objs(strAndObjAddPairs ...interface{}) (err error) { + str := "" + for k, v := range strAndObjAddPairs { + if k%2 == 0 { + str, _ = v.(string) + } else if str != "" { + if err = utils.UnmarshalUseNumber([]byte(str), v); err != nil { + return err + } + } + } + return nil +}