- 2019-07-26 疑似饿百将门店返回的坐标类型从float64改为string了
This commit is contained in:
@@ -71,6 +71,14 @@ func (p *PurchaseHandler) CreateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2019-07-26 疑似饿百将门店返回的坐标类型从float64改为string了
|
||||||
|
func getCoordintate(data interface{}) float64 {
|
||||||
|
if str, ok := data.(string); ok {
|
||||||
|
return utils.Str2Float64WithDefault(str, 0)
|
||||||
|
}
|
||||||
|
return utils.MustInterface2Float64(data)
|
||||||
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string) (*dao.StoreDetail, error) {
|
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string) (*dao.StoreDetail, error) {
|
||||||
baiduShopID := utils.Str2Int64(vendorStoreID)
|
baiduShopID := utils.Str2Int64(vendorStoreID)
|
||||||
result, err := api.EbaiAPI.ShopGet("", baiduShopID)
|
result, err := api.EbaiAPI.ShopGet("", baiduShopID)
|
||||||
@@ -96,8 +104,8 @@ func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string
|
|||||||
retVal.Tel2 = tel2
|
retVal.Tel2 = tel2
|
||||||
}
|
}
|
||||||
|
|
||||||
lng := utils.MustInterface2Float64(result["longitude"])
|
lng := getCoordintate(result["longitude"])
|
||||||
lat := utils.MustInterface2Float64(result["latitude"])
|
lat := getCoordintate(result["latitude"])
|
||||||
if utils.Interface2String(result["coord_type"]) == ebaiapi.CoordTypeBaidu {
|
if utils.Interface2String(result["coord_type"]) == ebaiapi.CoordTypeBaidu {
|
||||||
var err2 error
|
var err2 error
|
||||||
if lng, lat, err2 = api.AutonaviAPI.CoordinateConvert(lng, lat, autonavi.CoordSysBaidu); err2 != nil {
|
if lng, lat, err2 = api.AutonaviAPI.CoordinateConvert(lng, lat, autonavi.CoordSysBaidu); err2 != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user