From 922aec1533276663eeec61f322238692638edbca Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 17 Jan 2024 10:25:00 +0800 Subject: [PATCH] 1 --- platformapi/sfps2/sf_test.go | 7 +++++++ platformapi/uuptapi/uupt_test.go | 36 +++++++++++++++++++------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/platformapi/sfps2/sf_test.go b/platformapi/sfps2/sf_test.go index 696e351f..d1dc648e 100644 --- a/platformapi/sfps2/sf_test.go +++ b/platformapi/sfps2/sf_test.go @@ -1,8 +1,10 @@ package sfps2 import ( + "crypto/rand" "fmt" "git.rosy.net.cn/baseapi/utils" + "math/big" "strings" "testing" ) @@ -135,3 +137,8 @@ func TestNew(t *testing.T) { fmt.Println(lng, lat) } } + +func Test2(t *testing.T) { + n, _ := rand.Int(rand.Reader, big.NewInt(10000000000)) + println(n.Int64()) +} diff --git a/platformapi/uuptapi/uupt_test.go b/platformapi/uuptapi/uupt_test.go index 74e33899..0491bac2 100644 --- a/platformapi/uuptapi/uupt_test.go +++ b/platformapi/uuptapi/uupt_test.go @@ -5,6 +5,7 @@ import ( "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/utils" "go.uber.org/zap" + "strings" "testing" ) @@ -45,14 +46,14 @@ func init() { //计算运单价格 func TestGetWaybillPrice(t *testing.T) { param := &GetOrderPriceReq{ - OriginID: "T20230114M", - FromAddress: "万科加州湾V派", - ToAddress: "嘉华酒店", + OriginID: "88442688797068", + FromAddress: "成都市都江堰市中新巷四合院金杨调味", + ToAddress: "景中路宝石花石油花园天能电池(宝石花石油花园店)111", CityName: "成都市", SendType: "0", - ToLat: "29.604639", - ToLng: "103.743532", - FromLat: "29.608636", + ToLat: "30.985248", + ToLng: "103.638852", + FromLat: "103.639058", FromLng: "103.728641", //ToLat: "29.598951", //ToLng: "103.736961", @@ -103,15 +104,22 @@ func TestCancelOrder(t *testing.T) { fmt.Println(err) } -//辅助测试 -type tStruct struct { - name string -} - func Test(t *testing.T) { - zero := 0 - a := int(zero) * 100 - fmt.Printf("a====%d", a) + //a := "成都市" + a := "都江堰市" + b := "都江堰市" + c := "都江堰市中新巷四合院金杨调味" + d := "" + if !strings.Contains(c, a) { + d += a + //fmt.Println(d) + } + if !strings.Contains(c, b) { + d += b + } + d += c + fmt.Println(d) + } func TestGetOrderLiquidatedDamages(t *testing.T) {