From e2fd0b207485e3bfab4d4e4f51addd9b017e1ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 21 Feb 2025 15:33:57 +0800 Subject: [PATCH] 1 --- platformapi/mtwmapi/im_test.go | 4 ++-- platformapi/mtwmapi/mtwmapi_test.go | 4 ++-- platformapi/uuptapi/uupt_test.go | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/platformapi/mtwmapi/im_test.go b/platformapi/mtwmapi/im_test.go index 453bbb65..a1f29907 100644 --- a/platformapi/mtwmapi/im_test.go +++ b/platformapi/mtwmapi/im_test.go @@ -125,9 +125,9 @@ func TestAPI_GetPoiIMStatus(t *testing.T) { //for _, v := range ids { // retrieval, _ := api.GetPoiIMStatus(v) // ans += v + ":" + utils.Int2Str(retrieval.ImStatus) + "," - //} + //}` //fmt.Println(ans) - retrieval, _ := api.GetPoiIMStatus("18008153") + retrieval, _ := api.GetPoiIMStatus("25791090") fmt.Println(retrieval) } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index ec47f942..3d59d16f 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -20,13 +20,13 @@ func init() { baseapi.Init(sugarLogger) // 菜市 - api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") + //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_sinaAnZgfFZJkRIrdbJKBA") + api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_ouN_SJj1m7HALrIdnQFHlQ") //cookieStr := ` // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; //` diff --git a/platformapi/uuptapi/uupt_test.go b/platformapi/uuptapi/uupt_test.go index da33d115..8a764b00 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" + "math" "strings" "testing" ) @@ -130,3 +131,19 @@ func TestGetOrderLiquidatedDamages(t *testing.T) { t.Log(deductFee) } } +func TestChangeCoord(t *testing.T) { + lng, lat := GaodeCoord2BaiDu(104.057697, 30.69524) + fmt.Println(lng, lat) +} + +func GaodeCoord2BaiDu(lng, lat float64) (float64, float64) { + x := lng + y := lat + z := math.Sqrt(x*x+y*y) + 0.00002*math.Sin(y*math.Pi) + theta := math.Atan2(y, x) + 0.000003*math.Cos(x*math.Pi) + + bdLng := z*math.Cos(theta) + 0.0065 + bdLat := z*math.Sin(theta) + 0.006 + + return bdLng, bdLat +}