京东商城订单数据

This commit is contained in:
苏尹岚
2020-07-13 14:15:43 +08:00
parent 239ff56661
commit 584dbe8d79
7 changed files with 130 additions and 8 deletions

View File

@@ -37,12 +37,19 @@ func (a *API) GetDeliveryCompany() (result interface{}, err error) {
return result, err
}
type GetOrderResult struct {
}
//查询单个订单
//https://open.jd.com/home/home#/doc/api?apiCateId=55&apiId=4247&apiName=jingdong.pop.order.get
func (a *API) GetOrder(orderID int64) (err error) {
_, err = a.AccessAPI("jingdong.pop.order.get", prodURL, map[string]interface{}{
"order_id": orderID,
"optional_fields": "orderType,payType,orderTotalPrice,orderSellerPrice,orderPayment,freightPrice",
"order_id": orderID,
"optional_fields": `orderType,payType,orderTotalPrice,orderSellerPrice,
orderPayment,freightPrice,orderState,orderStateRemark,
orderStartTime,orderEndTime,orderRemark,consigneeInfo,
itemInfoList,pauseBizInfo`,
"order_state": "WAIT_SELLER_STOCK_OUT,PAUSE",
})
return err
}

View File

@@ -48,7 +48,7 @@ func TestGetProvince(t *testing.T) {
}
func TestGetCity(t *testing.T) {
result, err := api.GetCity(5)
result, err := api.GetCity(2)
if err != nil {
t.Fatal(err)
}
@@ -56,7 +56,7 @@ func TestGetCity(t *testing.T) {
}
func TestGetCounty(t *testing.T) {
result, err := api.GetCounty(199)
result, err := api.GetCounty(2834)
if err != nil {
t.Fatal(err)
}