From 63fd5b86c11f6bfdcde1abb18b4c82b1f6f373c8 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Tue, 8 Nov 2022 15:19:43 +0800 Subject: [PATCH] createwarehouse param --- .../tiktok_shop/tiktok_api/store_test.go | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index 79c3884a..e17e622a 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -19,7 +19,7 @@ import ( 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" - "reflect" + "math/rand" "strconv" "strings" "testing" @@ -279,22 +279,26 @@ func TestGetStoreSaleLimit(t *testing.T) { //更新电子围栏 func TestSplitFence(t *testing.T) { - tempStr := strings.Split("104.111331,30.67964544419017;104.13348225189759,30.671752134736078;104.14265760085712,30.652696;104.13348225189759,30.63363986526392;104.111331,30.625746555809826;104.08917974810242,30.63363986526392;104.0800043991429,30.652696;104.08917974810242,30.671752134736078", ";") - fmt.Println(len(tempStr)) - //var ( - // Longitude float64 - // Latitude float64 - //) - for v := len(tempStr) - 1; v >= 0; v-- { + tempStr := strings.Split("119.264545,26.059759;119.267963,26.055704;119.270453,26.056799;119.272496,26.054101;119.283454,26.049432;119.292113,26.043478;119.302748,26.04082;119.312766,26.046162;119.315166,26.042427;119.319187,26.029725;119.317819,26.016577;119.311271,26.004756;119.301256,25.996395;119.29311,25.999295;119.288793,25.991763;119.282818,25.996189;119.28234,25.998187;119.281131,25.997151;119.282488,25.99604;119.276974,25.99953;119.273954,25.99893;119.272637,26.001784;119.26865,26.003418;119.26928,25.999592;119.251217,26.018658;119.239497,26.024498;119.240308,26.034097;119.246036,26.046258;119.25243,26.052965;119.264545,26.059759;", ";") + str := []string{} + for _, v := range tempStr { + str = append(str, v) + } + fmt.Printf("str======%s\n", str) + fmt.Printf("len(str)======%d\n", len(str)) + for v := len(tempStr) - 1; v > 0; v-- { s2 := strings.Split(tempStr[v], ",") - //Longitude := utils.Str2Float64(s2[0]) Longitude, _ := strconv.ParseFloat(s2[0], 64) Latitude := utils.Str2Float64(s2[1]) - fmt.Printf("%f,%f\n", Longitude, Latitude) - fmt.Println("Longitude type:", reflect.TypeOf(Longitude)) - fmt.Println("Latitude type:", reflect.TypeOf(Latitude)) + fmt.Printf("Longitude=============%f,Latitude================%f\n", Longitude, Latitude) + //fmt.Println("Longitude type:", reflect.TypeOf(Longitude)) + //fmt.Println("Latitude type:", reflect.TypeOf(Latitude)) } } +func TestGetAns(t *testing.T) { + rand.Seed(time.Now().Unix()) + fmt.Println((rand.Intn(999-8) + 8) % 8) +} //运费模板 //创建运费模板