尝试获取京东商城订单
This commit is contained in:
@@ -36,3 +36,13 @@ func (a *API) GetDeliveryCompany() (result interface{}, err error) {
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
//查询单个订单
|
||||
//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",
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -21,3 +21,11 @@ func TestGetDeliveryCompany(t *testing.T) {
|
||||
}
|
||||
t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestGetOrder(t *testing.T) {
|
||||
err := api.GetOrder(120146365818)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -48,7 +49,7 @@ func TestGetProvince(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetCity(t *testing.T) {
|
||||
result, err := api.GetCity(12)
|
||||
result, err := api.GetCity(4)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -56,7 +57,7 @@ func TestGetCity(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetCounty(t *testing.T) {
|
||||
result, err := api.GetCounty(988)
|
||||
result, err := api.GetCounty(50953)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -96,7 +97,5 @@ func TestFindStoreInfoByExtStoreId(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestWIREHL(t *testing.T) {
|
||||
data := "http://image.jxc4.com/image/f8578c9ee724408d514bbbfac3461142.tem.png"
|
||||
res := base64.URLEncoding.EncodeToString([]byte(data))
|
||||
fmt.Println(res)
|
||||
fmt.Println(time.Now().Sub(utils.Str2Time("2020-06-29 00:00:00")) > 24*time.Hour)
|
||||
}
|
||||
|
||||
@@ -458,10 +458,12 @@ func (a *API) ResetCoverImage(userId, keyword string) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = a.AccessStorePage("Product/ResetCoverImage", map[string]interface{}{
|
||||
"productImageId": findProductResult.Productimages[len(findProductResult.Productimages)-1].ID,
|
||||
"forMulColorSize": false,
|
||||
})
|
||||
if len(findProductResult.Productimages) > 0 {
|
||||
_, err = a.AccessStorePage("Product/ResetCoverImage", map[string]interface{}{
|
||||
"productImageId": findProductResult.Productimages[len(findProductResult.Productimages)-1].ID,
|
||||
"forMulColorSize": false,
|
||||
})
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user