- autonavi api added.

- other refactor.
This commit is contained in:
gazebo
2018-07-14 13:13:58 +08:00
parent 1ec75cafd0
commit 90f21ffb8d
6 changed files with 267 additions and 42 deletions

View File

@@ -142,10 +142,10 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
sign := a.signParams(params)
params[signKey] = sign
url, _ := url.Parse(utils.GenerateGetURL(prodURL, apiStr, params))
finalURL, _ := url.Parse(utils.GenerateGetURL(prodURL, apiStr, params))
request := &http.Request{
Method: "GET",
URL: url,
URL: finalURL,
}
err = platformapi.AccessPlatformAPIWithRetry(a.client, request, a.config, func(response *http.Response) (errLevel string, err error) {
jsonResult1, err := utils.HTTPResponse2Json(response)

View File

@@ -39,6 +39,16 @@ const (
DeliveryStatusFinished = "40"
)
const (
PromotionTypeNormal = 1
PromotionTypeSeckill = 2
PromotionTypeDirectDown = 3
PromotionTypeLimitedTime = 4
PromotionTypeAddMoneyBuy = 1202
PromotionTypeOverflowGiveGift = 1203
PromotionTypeBuyGiveGift = 6
)
func (a API) OrderQuery(jdParams map[string]interface{}) (retVal []interface{}, err error) {
retVal, err = a.AccessAPIHavePage("order/es/query", jdParams, nil, nil, nil)
return