This commit is contained in:
邹宗楠
2022-08-26 09:35:34 +08:00
parent d3c3dbf388
commit c950fb0d12
2 changed files with 12 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"strings"
"time" "time"
) )
@@ -595,6 +596,9 @@ func (a *API) OrderLogisticsChange2Self(orderID int64) (err error) {
_, err = a.AccessAPI("order/logistics/change/poi_self", false, map[string]interface{}{ _, err = a.AccessAPI("order/logistics/change/poi_self", false, map[string]interface{}{
KeyOrderID: orderID, KeyOrderID: orderID,
}) })
if strings.Contains(err.Error(), "1047") {
return a.OrderDelivering(orderID)
}
return err return err
} }

View File

@@ -2,6 +2,7 @@ package mtwmapi
import ( import (
"fmt" "fmt"
"strings"
"testing" "testing"
"time" "time"
@@ -170,3 +171,10 @@ func TestAa2(t *testing.T) {
"response_type": "token", "response_type": "token",
}), time) }), time)
} }
func TestDeleving(t *testing.T) {
err := api.OrderLogisticsChange2Self(148815412830472574)
fmt.Println(strings.Contains(err.Error(), "1047"))
t.Fatal(err)
}