diff --git a/platformapi/ebaiapi/ebaiapi_test.go b/platformapi/ebaiapi/ebaiapi_test.go index ce86377b..467decd2 100644 --- a/platformapi/ebaiapi/ebaiapi_test.go +++ b/platformapi/ebaiapi/ebaiapi_test.go @@ -29,13 +29,13 @@ func init() { // api = New("62289", "d3ec2358d6a819ea") // 京西菜市 - //api = New("34665", "c3db75b754ea2d89") + api = New("34665", "c3db75b754ea2d89") //菜市测试 // api = New("62923", "aa4cdc6c1108486b") // 京西果园 - api = New("35957", "10013fbb7c2ddad7") + //api = New("35957", "10013fbb7c2ddad7") // api.SetCookie("PASSPORT_DELIMONT_TOKEN", "PBE_2.0_5cd1c6141c127d4188f026ac01fc93656266683e8dfb3127c2fdf894259e9034125ff3bdd2a997a385802ee3ef1802ba93a04acea34fde2d2b6e802c5dcd4ec6e3f4ad909a1d806e3ceeb349ed726b03d60ed1fe7010d4140aa338d9c5f05e3fec172c78d3d7f0ca579d61b7015af1bf99aa46b04d2b8a64aa50646dc09afe94b6b60e0ba9a933635db5e8b2a035e9b6d693b289acf1b256d5b9a3f8478c87b0b009115bfd1394f20bb5a0dc2c07b8d013a25f286ec6bf7f2d86010d65507e31358834b7a6b58fbd88cb3f1a12cf71c997b91c1527f6f3c10693f7c2bd6073da8633a98cd2dc1114dfa5be5ee0e60b02cf7e4a94d0fb563a8c01717e7c050f02249117219c07a2eb211577c208ba77f4d536fa25139bc249be93b38d6fc495ef67a32aa206835d177db402bc534de1d29caf4f6b4fbcd912c13f167d00d1732222744c336a5189728f72fb5e153c4b1164171cfb0c811f34f4c2fedd43f721b8706b43f8d631251c") //api.SetCookie("WMUSS", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ") //api.SetCookie("WMSTOKEN", "NTE2NDMTAwMDAyNzYxNzAwOTEyTmUzNWJNcDlQ ") diff --git a/platformapi/tiktok_shop/tiktok_api/-test.v.gif b/platformapi/tiktok_shop/tiktok_api/-test.v.gif new file mode 100644 index 00000000..1c3122bc Binary files /dev/null and b/platformapi/tiktok_shop/tiktok_api/-test.v.gif differ diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index 42c0103d..6aef8aad 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -445,3 +445,21 @@ func BatchStr2Time(strTime ...string) (timeList []time.Time, err error) { func TestPrint(t *testing.T) { globals.SugarLogger.Debugf("%d", []int{1, 2, 3, 46, 65}) } + +//func TestToMap(t *testing.T) { +// data:=" "57939570":[{"123":"987"},{"124":"988"},{"125":"989"},{"126":"990"},{"127":"991"}] " +// result, err := utils.Unmarshal2Map([]byte(data), &payload) +// +//} +// +//func toMap(actual interface{}) ([]string, error) { +// var res []string +// value := reflect.ValueOf(actual) +// if value.Kind() != reflect.Slice && value.Kind() != reflect.Array { +// return nil, errors.New("parse error") +// } +// for i := 0; i < value.Len(); i++ { +// res = append(res, value.Index(i).Interface().(string)) +// } +// return res, nil +//} diff --git a/utils/typeconv.go b/utils/typeconv.go index 66da9b30..e76a9acc 100644 --- a/utils/typeconv.go +++ b/utils/typeconv.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "git.rosy.net.cn/jx-callback/globals" "math" "net/url" "reflect" @@ -43,6 +44,7 @@ func TryUnmarshalUseNumber(data []byte, result interface{}) error { // 这个函数将解析json,返回的map中的字段类型与structObj中的完全一样的 func Unmarshal2Map(data []byte, structObj interface{}) (resultMap map[string]interface{}, err error) { + globals.SugarLogger.Debugf("进入Unmarshal2Map") if err = json.Unmarshal(data, structObj); err == nil { if err = json.Unmarshal(data, &resultMap); err == nil { m := Struct2MapByJson(structObj) @@ -55,6 +57,7 @@ func Unmarshal2Map(data []byte, structObj interface{}) (resultMap map[string]int } } } + globals.SugarLogger.Debugf("resultMap===========%v err=======%v", resultMap, err) return resultMap, err }