This commit is contained in:
richboo111
2023-01-09 13:50:02 +08:00
parent eee0e2b9fd
commit c4223bbf96
5 changed files with 227 additions and 141 deletions

View File

@@ -3,6 +3,7 @@ package tiktok_api
import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
"reflect"
"testing"
)
@@ -16,10 +17,34 @@ func TestCancelWaybill(t *testing.T) {
err := a.ShopOrderDispatcher(62490423, "5017358149445080799", 2)
fmt.Println(err)
}
type tete struct {
ids []int64
name string
}
func Test(t *testing.T) {
a := make([]int64, 0)
Strings2Objs(`[1262627,1723872383]`, &a)
fmt.Println(a)
//var a []int64
var b interface{}
//stType := reflect.TypeOf(a)
//stValue := reflect.ValueOf(a)
x := reflect.TypeOf(b)
fmt.Println(reflect.TypeOf(a) == reflect.TypeOf([]int64{}))
switch x {
case reflect.TypeOf([]int64{}):
fmt.Println(1)
case reflect.TypeOf([]string{}):
fmt.Println(2)
}
//fmt.Println(stType.NumField())
//fmt.Println(stType.Field(0))
//temp := stType.Field(0)
//fmt.Println(temp.Type)
//Strings2Objs(`[1262627,1723872383]`, &a)
//fmt.Printf("%v", reflect.TypeOf(a).NumField())
}
func Strings2Objs(strAndObjAddPairs ...interface{}) (err error) {
str := ""