jd 查询物流重量
This commit is contained in:
@@ -437,3 +437,22 @@ func (a *API) QueryDynamicTraceInfo(waybillCode string) (err error) {
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
type WaybillQueryResult struct {
|
||||
Weight float64 `json:"weight"`
|
||||
DeliveryID string `json:"deliveryId"`
|
||||
GoodNumber int `json:"goodNumber"`
|
||||
}
|
||||
|
||||
//京东物流运单查询
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=64&apiId=2189&apiName=jingdong.ldop.waybill.query
|
||||
func (a *API) WaybillQuery(deliveryId string) (waybill *WaybillQueryResult, err error) {
|
||||
result, err := a.AccessAPI("jingdong.ldop.waybill.query", prodURL, map[string]interface{}{
|
||||
"deliveryId": deliveryId,
|
||||
"customerCode": CustomerCode,
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result["jingdong_ldop_waybill_query_responce"].(map[string]interface{})["resultInfo"].(map[string]interface{})["data"], &waybill, false)
|
||||
}
|
||||
return waybill, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user