From 7c88b4b7bd75b13de5d8003fa8dae3ff8eb0f0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 23 Oct 2020 14:50:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E7=89=A9=E6=B5=81=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdeclpapi/jdeclpapi.go | 9 +++++++++ platformapi/jdshopapi/store_test.go | 6 +++--- platformapi/yilianyunapi/yilianyunapi_test.go | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/platformapi/jdeclpapi/jdeclpapi.go b/platformapi/jdeclpapi/jdeclpapi.go index 01b46591..fb1466d2 100644 --- a/platformapi/jdeclpapi/jdeclpapi.go +++ b/platformapi/jdeclpapi/jdeclpapi.go @@ -428,3 +428,12 @@ func (a *API) CancelWayBill(cancelWayBillParam *CancelWayBillParam) (err error) _, err = a.AccessAPI("jingdong.ldop.delivery.provider.cancelWayBill", prodURL, utils.Struct2FlatMap(cancelWayBillParam)) return err } + +//京东物流全程跟踪接口 +//https://open.jd.com/home/home#/doc/api?apiCateId=64&apiId=4257&apiName=jingdong.trace.dynamicQueryService.queryDynamicTraceInfo +func (a *API) QueryDynamicTraceInfo(waybillCode string) (err error) { + _, err = a.AccessAPI("jingdong.trace.dynamicQueryService.queryDynamicTraceInfo", prodURL, map[string]interface{}{ + "waybillCode": waybillCode, + }) + return err +} diff --git a/platformapi/jdshopapi/store_test.go b/platformapi/jdshopapi/store_test.go index 0167a1f2..c198aed3 100644 --- a/platformapi/jdshopapi/store_test.go +++ b/platformapi/jdshopapi/store_test.go @@ -3,8 +3,9 @@ package jdshopapi import ( "encoding/base64" "fmt" - "strings" + "math/rand" "testing" + "time" "git.rosy.net.cn/baseapi/utils" ) @@ -97,6 +98,5 @@ func TestFindStoreInfoByExtStoreId(t *testing.T) { } func TestWIREHL(t *testing.T) { - str := "https://51106.cn/c/22f06354336ca9" - fmt.Println(str[strings.LastIndex(str, "/")+1 : len(str)]) + fmt.Println(fmt.Sprintf("%06v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(1000000))) } diff --git a/platformapi/yilianyunapi/yilianyunapi_test.go b/platformapi/yilianyunapi/yilianyunapi_test.go index 4e14246e..ea5ce4e9 100644 --- a/platformapi/yilianyunapi/yilianyunapi_test.go +++ b/platformapi/yilianyunapi/yilianyunapi_test.go @@ -65,13 +65,13 @@ func TestPrintMsgWithToken(t *testing.T) { } func TestGetPrintStatus(t *testing.T) { - state, err := api.GetPrintStatus("4004653390") + state, err := api.GetPrintStatus("4004627655") handleError(t, err) baseapi.SugarLogger.Debug(state) } func TestGetPrintStatusWithToken(t *testing.T) { - state, err := api.GetPrintStatusWithToken("4004653390", "07e5895c70114395a285ae20119d83b1") + state, err := api.GetPrintStatusWithToken("4004627655", "308344d0cb74469eb892b26eaffffca2") handleError(t, err) baseapi.SugarLogger.Debug(state) }