diff --git a/platformapi/dadaapi/dadaapi.go b/platformapi/dadaapi/dadaapi.go index f50a77b9..d77a38ff 100644 --- a/platformapi/dadaapi/dadaapi.go +++ b/platformapi/dadaapi/dadaapi.go @@ -177,3 +177,12 @@ func (a *API) GetCancelReasons() (retVal []CancelReason, err error) { } return retVal, nil } + +func IsErrShopNotExist(err error) bool { + if err != nil { + if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == ResponseCodeShopNotExist { + return true + } + } + return false +} diff --git a/platformapi/dadaapi/shop_test.go b/platformapi/dadaapi/shop_test.go index 0fd80304..418da217 100644 --- a/platformapi/dadaapi/shop_test.go +++ b/platformapi/dadaapi/shop_test.go @@ -39,6 +39,7 @@ func TestShopUpdate(t *testing.T) { shopInfo := &ShopInfo{ OriginShopID: "18180948107", StationName: "京西大本营234", + CityName: "包头市", } err := dadaapi.ShopUpdate(shopInfo) if err != nil { diff --git a/platformapi/mtpsapi/mtpsapi.go b/platformapi/mtpsapi/mtpsapi.go index ef01a967..cc6ad9ac 100644 --- a/platformapi/mtpsapi/mtpsapi.go +++ b/platformapi/mtpsapi/mtpsapi.go @@ -80,7 +80,8 @@ const ( // 错误码 const ( - ResponseCodeSuccess = 0 + ResponseCodeSuccess = 0 + ResponseCodeShopNotExist = 112 // 门店不存在 ) // 取消原因 @@ -376,3 +377,12 @@ func (a *API) SimulateRearrange(deliveryId int64, mtPeiSongId string) (err error func (a *API) SimulateReportException(deliveryId int64, mtPeiSongId string) (err error) { return a.simulateOrderBehavior("reportException", deliveryId, mtPeiSongId) } + +func IsErrShopNotExist(err error) bool { + if err != nil { + if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == ResponseCodeShopNotExist { + return true + } + } + return false +}