This commit is contained in:
邹宗楠
2023-10-27 18:13:54 +08:00
parent f095bc9b32
commit 3b97347fe8

View File

@@ -1,7 +1,6 @@
package cms
import (
"encoding/json"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"math"
@@ -740,9 +739,13 @@ func GetCyclingLine(sLng, sLat, uLng, uLat float64) (polyLineList []string, dist
return nil, 0, 0, fmt.Errorf("获取骑行规划路线错误")
}
path := &baidunavi.RiderPath{}
if err := json.Unmarshal([]byte(data.(string)), path); err != nil {
if err := utils.Map2StructByJson(data, path, false); err != nil {
return nil, 0, 0, err
}
globals.SugarLogger.Debugf("==============:path %s", utils.Format4Output(path, false))
//if err := json.Unmarshal([]byte(data.(map[string]interface{})), path); err != nil {
// return nil, 0, 0, err
//}
if path.Status != model.NO {
return nil, 0, 0, fmt.Errorf("%d,%s", path.Status, path.Message)
}