京东修改分类名忽略没有实际修改错(即当前的与要修改的一样)

This commit is contained in:
gazebo
2020-01-09 09:27:55 +08:00
parent 3bf8e50858
commit 41eae85742
2 changed files with 38 additions and 11 deletions

View File

@@ -340,9 +340,16 @@ func (a *API) UpdateShopCategory(id int64, shopCategoryName string) error {
KeyShopCategoryName: shopCategoryName,
}
_, err := a.AccessAPINoPage("pms/updateShopCategory", params, nil, nil, nullResultParser)
if IsErrIgnorable(err) {
err = nil
}
return err
}
func IsErrIgnorable(err error) bool {
return err == nil || utils.IsErrMatch(err, "-3", []string{"店内分类名称未修改,无需操作"})
}
// 修改商家店内分类顺序接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=2a8267602e814be9828f0c7ce307b872
func (a *API) ChangeShopCategoryOrder(pid int64, childIds []int64) error {