This commit is contained in:
邹宗楠
2023-09-06 15:02:53 +08:00
parent 979f9565bd
commit 5ed3015c61
4 changed files with 9 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ func (a *API) GetCyclingPlan(origin, destination string) ([]string, int64, int64
return nil, 0, 0, err
}
var data *CyclingPlan
if err := utils.Map2StructByJson(result, data, false); err != nil {
if err := utils.Map2StructByJson(result, &data, false); err != nil {
return nil, 0, 0, err
}

View File

@@ -8,7 +8,11 @@ import (
func TestGetCyclingPlan(t *testing.T) {
key := "e44ae2850c0ac930b65c9652d2db0321"
a := New(key)
a.GetCyclingPlan("113.854912,22.601450", "113.846355,22.625570")
data1, dada2, dada3, err := a.GetCyclingPlan("104.045460,30.693001", "104.045474,30.693344")
fmt.Println(data1)
fmt.Println(dada2)
fmt.Println(dada3)
fmt.Println(err)
}
func TestLng(t *testing.T) {