1
This commit is contained in:
@@ -182,7 +182,7 @@ func (a *API) AccessAPI(apiStr string, params map[string]interface{}) (retVal in
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(utils.Interface2String(jsonResult1["message"]), status)
|
||||
if _, ok := exceedLimitCodes[status]; ok {
|
||||
return platformapi.ErrLevelExceedLimit, newErr
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else if _, ok := canRetryCodes[status]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-print/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -15,12 +15,23 @@ func TestGetDispatcherInfo(t *testing.T) {
|
||||
fmt.Println(err)
|
||||
}
|
||||
func TestCancelWaybill(t *testing.T) {
|
||||
token := `{"access_token":"6cf0af8c-8d96-4d20-b1e3-91187f31e694","expires_in":1698285505,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"69b9fd26-ff8a-48ab-ae50-b5241aa1ee03","authority_id":""}`
|
||||
//token := `{"access_token":"6cf0af8c-8d96-4d20-b1e3-91187f31e694","expires_in":1698285505,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"69b9fd26-ff8a-48ab-ae50-b5241aa1ee03","authority_id":""}`
|
||||
var token = `{"access_token":"8a693254-f1e8-4427-b41f-6762a88fd53a","expires_in":1698285505,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"265c95d1-7c6b-407b-ab8c-2481c993480f","authority_id":""}`
|
||||
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token)
|
||||
err := a.ShopOrderDispatcher(95431015, "6922785324337338227", 2)
|
||||
err := a.ShopOrderDispatcher(102518751, "6922795601625880116", 2)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
func TestGetShipmentInfo(t *testing.T) {
|
||||
//var token = `{"access_token":"6cf0af8c-8d96-4d20-b1e3-91187f31e694","expires_in":1698285505,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"69b9fd26-ff8a-48ab-ae50-b5241aa1ee03","authority_id":""}`
|
||||
var token = `{"access_token":"8a693254-f1e8-4427-b41f-6762a88fd53a","expires_in":1698285505,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"265c95d1-7c6b-407b-ab8c-2481c993480f","authority_id":""}`
|
||||
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token)
|
||||
|
||||
data, err := a.GetShipmentInfo(6922795601625880116, 0, ShipmentTypeInvoice)
|
||||
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(data, false))
|
||||
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(err, false))
|
||||
}
|
||||
|
||||
type tete struct {
|
||||
ids []int64
|
||||
name string
|
||||
@@ -40,16 +51,6 @@ func Test(t *testing.T) {
|
||||
fmt.Println(50|2, 3|2)
|
||||
}
|
||||
|
||||
func TestGetShipmentInfo(t *testing.T) {
|
||||
var token = `{"access_token":"6cf0af8c-8d96-4d20-b1e3-91187f31e694","expires_in":1698285505,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"69b9fd26-ff8a-48ab-ae50-b5241aa1ee03","authority_id":""}`
|
||||
//var token = `{"access_token":"8a693254-f1e8-4427-b41f-6762a88fd53a","expires_in":1698285505,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"265c95d1-7c6b-407b-ab8c-2481c993480f","authority_id":""}`
|
||||
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token)
|
||||
|
||||
data, err := a.GetShipmentInfo(6922785324337338227, 0, ShipmentTypeInvoice)
|
||||
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(data, false))
|
||||
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(err, false))
|
||||
}
|
||||
|
||||
func TestGetStoreAutoCallRiderInfo(t *testing.T) {
|
||||
a.GetStoreAutoCallRiderInfo(64212030)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user