Merge branch 'master' of https://e.coding.net/rosydev/baseapi
This commit is contained in:
@@ -48,19 +48,19 @@ type CallbackRefundInfo struct {
|
||||
AppID string `json:"app_id"`
|
||||
Sig string `json:"sig"`
|
||||
|
||||
OrderID int64 `json:"order_id"`
|
||||
NotifyType string `json:"notify_type"`
|
||||
RefundID int64 `json:"refund_id"`
|
||||
Ctime int64 `json:"ctime"`
|
||||
Reason string `json:"reason"`
|
||||
ResType int `json:"res_type"`
|
||||
IsAppeal int `json:"is_appeal"`
|
||||
Pictures string `json:"pictures"`
|
||||
PictureList []string `json:"pictureList"`
|
||||
|
||||
Food string `json:"food"`
|
||||
FoodList []*RefundSkuDetail `json:"foodList"`
|
||||
Money float32 `json:"money"`
|
||||
OrderID int64 `json:"order_id"`
|
||||
NotifyType string `json:"notify_type"`
|
||||
RefundID int64 `json:"refund_id"`
|
||||
Ctime int64 `json:"ctime"`
|
||||
Reason string `json:"reason"`
|
||||
ResType int `json:"res_type"`
|
||||
IsAppeal int `json:"is_appeal"`
|
||||
Pictures string `json:"pictures"`
|
||||
PictureList []string `json:"pictureList"`
|
||||
Status string `json:"status"`
|
||||
Food string `json:"food"`
|
||||
FoodList []*RefundSkuDetail `json:"foodList"`
|
||||
Money float32 `json:"money"`
|
||||
}
|
||||
|
||||
type CallbackMsg struct {
|
||||
|
||||
@@ -599,7 +599,10 @@ func (a *API) GetDeliveryPath(orderId int64, appPoiCode string) (lng, lat int, e
|
||||
if err := json.Unmarshal(path, &riderPath); err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil
|
||||
if len(riderPath) > 0 {
|
||||
return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil
|
||||
}
|
||||
return 0, 0, nil
|
||||
}
|
||||
|
||||
// OrderLogisticsFee 获取订单配送费
|
||||
|
||||
@@ -88,7 +88,12 @@ func TestOrderLogisticsStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetDeliveryPath(t *testing.T) {
|
||||
api.GetDeliveryPath(1000713330160837459, "7821254")
|
||||
data1, data2, err := api.GetDeliveryPath(1100718012566212160, "7290541")
|
||||
fmt.Println(data1)
|
||||
fmt.Println(data2)
|
||||
fmt.Println(utils.Float64ToStr(float64(data1) / 1000000))
|
||||
fmt.Println(utils.Float64ToStr(float64(data2) / 1000000))
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
func TestOrderLogisticsFee(t *testing.T) {
|
||||
@@ -252,5 +257,7 @@ func TestLen(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestName(t *testing.T) {
|
||||
fmt.Println((10 & 2) != 0)
|
||||
data := map[int]int{101: 1, 102: 1, 103: 1}
|
||||
|
||||
fmt.Println(data[1] == 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user