1
This commit is contained in:
@@ -49,7 +49,9 @@ func New(appID, serialNo, sM4Key, clientId, clientSecret, incomingToken, changeT
|
||||
|
||||
// AccessAPI form表单格式
|
||||
func (a *API) AccessAPI(baseUrl, action, method string, pathParam string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) {
|
||||
a.CheckToken()
|
||||
if method != TokenActive {
|
||||
a.CheckToken()
|
||||
}
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||
func() *http.Request {
|
||||
var request *http.Request
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestModifiedToken(t *testing.T) {
|
||||
// TestOrganization 获取城市组织代码
|
||||
func TestOrganization(t *testing.T) {
|
||||
// 6510 成都市 6515 金牛
|
||||
organizationList, err := api.GetOrganizationCode("6510")
|
||||
organizationList, err := api.GetOrganizationCode("1")
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %v", err)
|
||||
} else {
|
||||
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_oku5J6-UzKWdNwcNdXNOKA")
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_lfakvRM4GLSa_VLMUIZDHA")
|
||||
//cookieStr := `
|
||||
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
//`
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -419,6 +420,9 @@ func (a *API) OrderLogisticsChange2Self(orderID int64) (err error) {
|
||||
_, err = a.AccessAPI("order/logistics/change/poi_self", false, map[string]interface{}{
|
||||
KeyOrderID: orderID,
|
||||
})
|
||||
if err != nil && strings.Contains(err.Error(), "您的配送单已取消") {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time {
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail(t *testing.T) {
|
||||
result, err := api.OrderGetOrderDetail(5401564660946475322, false)
|
||||
result, err := api.OrderGetOrderDetail(2001664651373743860, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ const (
|
||||
PeiSongTypeQiKe = "4015" // 企客远距离配送
|
||||
PeiSongTypeMixedExpressQiKe = "30012002" // 混合快送
|
||||
PeiSongTypeFranchise = "30011001" // 混合加盟送
|
||||
PeiSongTypeMixedSelf = "30011002" // 混合自建
|
||||
PeiSongTypeNewQuik = "1007" // 新快送
|
||||
)
|
||||
|
||||
func (a *API) ShippingSave(poiCode string, area string, minPrice, shippingFee float32) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user