- mtps与dada.IsErrShopNotExist
This commit is contained in:
@@ -177,3 +177,12 @@ func (a *API) GetCancelReasons() (retVal []CancelReason, err error) {
|
|||||||
}
|
}
|
||||||
return retVal, nil
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ func TestShopUpdate(t *testing.T) {
|
|||||||
shopInfo := &ShopInfo{
|
shopInfo := &ShopInfo{
|
||||||
OriginShopID: "18180948107",
|
OriginShopID: "18180948107",
|
||||||
StationName: "京西大本营234",
|
StationName: "京西大本营234",
|
||||||
|
CityName: "包头市",
|
||||||
}
|
}
|
||||||
err := dadaapi.ShopUpdate(shopInfo)
|
err := dadaapi.ShopUpdate(shopInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ const (
|
|||||||
// 错误码
|
// 错误码
|
||||||
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) {
|
func (a *API) SimulateReportException(deliveryId int64, mtPeiSongId string) (err error) {
|
||||||
return a.simulateOrderBehavior("reportException", deliveryId, mtPeiSongId)
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user