增添jd的订单拆分接口
This commit is contained in:
@@ -144,7 +144,7 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
|
|||||||
sign := a.signParams(params)
|
sign := a.signParams(params)
|
||||||
params[signKey] = sign
|
params[signKey] = sign
|
||||||
request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), nil)
|
request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), nil)
|
||||||
request.Close = true //todo 为了避免EOF错误
|
//request.Close = true //todo 为了性能考虑
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client, request, a.config, func(response *http.Response) (errLevel string, err error) {
|
err = platformapi.AccessPlatformAPIWithRetry(a.client, request, a.config, func(response *http.Response) (errLevel string, err error) {
|
||||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ func init() {
|
|||||||
baseapi.Init(sugarLogger)
|
baseapi.Init(sugarLogger)
|
||||||
|
|
||||||
// sandbox
|
// sandbox
|
||||||
jdapi = New("c8854ef2-f80a-45ee-aceb-dc8014d646f8", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
|
//jdapi = New("c8854ef2-f80a-45ee-aceb-dc8014d646f8", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
|
||||||
// prod
|
// prod
|
||||||
// jdapi = New("91633f2a-c5f5-4982-a925-a220d19095c3", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
jdapi = New("91633f2a-c5f5-4982-a925-a220d19095c3", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTest(t *testing.T) {
|
func TestTest(t *testing.T) {
|
||||||
|
|||||||
16
platformapi/jdapi/order_test.go
Normal file
16
platformapi/jdapi/order_test.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package jdapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_QueryOassBussMoney(t *testing.T) {
|
||||||
|
bussResult, bussErr := jdapi.QueryOassBussMoney("815536199000222")
|
||||||
|
|
||||||
|
if bussErr != nil {
|
||||||
|
t.Error(bussErr.Error())
|
||||||
|
}
|
||||||
|
if len(bussResult) <= 0 {
|
||||||
|
t.Error("错误:返回数据长度不该为0")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user