- delivery.IsErrShopExist
This commit is contained in:
@@ -186,3 +186,12 @@ func IsErrShopNotExist(err error) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsErrShopExist(err error) bool {
|
||||||
|
if err != nil {
|
||||||
|
if errExt, ok := err.(*utils.ErrorWithCode); ok && errExt.IntCode() == ResponseCodeShopAlreadyExist {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ const (
|
|||||||
// 错误码
|
// 错误码
|
||||||
const (
|
const (
|
||||||
ResponseCodeSuccess = 0
|
ResponseCodeSuccess = 0
|
||||||
|
ResponseCodeInvalidParam = 4 // 参数格式错误
|
||||||
ResponseCodeShopNotExist = 112 // 门店不存在
|
ResponseCodeShopNotExist = 112 // 门店不存在
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,15 @@ func IsErrShopNotExist(err error) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsErrShopExist(err error) bool {
|
||||||
|
if err != nil {
|
||||||
|
return utils.IsErrMatch(err, utils.Int2Str(ResponseCodeInvalidParam), []string{
|
||||||
|
"该合作方下已存在outerPoiId",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (a *API) SimulateShopStatus(shopID string, status int) (err error) {
|
func (a *API) SimulateShopStatus(shopID string, status int) (err error) {
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
"shop_id": shopID,
|
"shop_id": shopID,
|
||||||
|
|||||||
Reference in New Issue
Block a user