From cef043546f3c1b25bf4f5b612fb2773ab57825f8 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 24 Oct 2019 16:13:38 +0800 Subject: [PATCH] =?UTF-8?q?mtwmapi.IsErrCategoryNotExist=E8=80=83=E8=99=91?= =?UTF-8?q?=E4=BD=BF=E7=94=A8RetailCatSkuBatchDelete2=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/mtwmapi/retail.go | 5 ++++- platformapi/mtwmapi/retail_test.go | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/platformapi/mtwmapi/retail.go b/platformapi/mtwmapi/retail.go index 7e35022f..722f5f22 100644 --- a/platformapi/mtwmapi/retail.go +++ b/platformapi/mtwmapi/retail.go @@ -453,7 +453,10 @@ func IsErrCategoryExist(err error) (isExist bool) { } func IsErrCategoryNotExist(err error) (isNotExist bool) { - return utils.IsErrMatch(err, utils.Int2Str(ErrCodeSkuCategoryNotExist), nil) + return utils.IsErrMatch(err, utils.Int2Str(ErrCodeSkuCategoryNotExist), nil) || + utils.IsErrMatch(err, utils.Int2Str(ErrCodeParameterFormatWrong), []string{ + "门店内不存在该分类", + }) } func IsErrSkuNotExist(err error) (isExist bool) { diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 9900e28b..ed562b76 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -88,6 +88,7 @@ func TestRetailGetSpTagIds(t *testing.T) { func TestRetailCatSkuBatchDelete(t *testing.T) { err := api.RetailCatSkuBatchDelete2(utils.GetUUID(), testPoiCode, nil, []string{"精品水果2"}, nil, nil, nil) + t.Log(IsErrCategoryNotExist(err)) if err != nil { t.Fatal(err) }