From c178cc7bea31998bf2512c4f3490f213b001613e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 19 Oct 2023 16:25:15 +0800 Subject: [PATCH] 1 --- platformapi/baidunavi/baidunavi.go | 2 +- .../tiktok_shop/tiktok_api/transport_test.go | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/platformapi/baidunavi/baidunavi.go b/platformapi/baidunavi/baidunavi.go index 4c1a7d09..fff324d8 100644 --- a/platformapi/baidunavi/baidunavi.go +++ b/platformapi/baidunavi/baidunavi.go @@ -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 { diff --git a/platformapi/tiktok_shop/tiktok_api/transport_test.go b/platformapi/tiktok_shop/tiktok_api/transport_test.go index 162f21dd..ffdd9ba3 100644 --- a/platformapi/tiktok_shop/tiktok_api/transport_test.go +++ b/platformapi/tiktok_shop/tiktok_api/transport_test.go @@ -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) }