mtwmapi.RetailCatSkuBatchDelete2
This commit is contained in:
@@ -235,6 +235,9 @@ func handleRetailBatchResultByRegexp(result interface{}) (failedFoodList []*AppF
|
||||
}
|
||||
|
||||
// 商品名最长30个字符(非字节)
|
||||
// 此函数可能创建相同foodCode的商品,如下问题的回复中有提到
|
||||
// https://developer.waimai.meituan.com/home/myquestionDetail/6716
|
||||
// 另外这个接口即使不指定operate_type为1,也可能报错:”商品spu名称在该店内分类中已存在“,原因就是已经存在两个相同的SKU了
|
||||
func (a *API) RetailInitData(trackInfo, poiCode, foodCode string, params map[string]interface{}) (err error) {
|
||||
_, err = a.AccessAPI2("retail/initdata", false, utils.MergeMaps(map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
@@ -387,6 +390,31 @@ func (a *API) RetailCatSkuBatchDelete(trackInfo, poiCode string, catNames []stri
|
||||
return err
|
||||
}
|
||||
|
||||
// 批量删除商品分类及商品
|
||||
// https://developer.waimai.meituan.com/home/docDetail/286
|
||||
func (a *API) RetailCatSkuBatchDelete2(trackInfo, poiCode string, catCodes, catNames, secondaryCatCodes, secondaryCatNames, foodCodes []string) (err error) {
|
||||
params := map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
}
|
||||
if len(catCodes) > 0 {
|
||||
params["category_codes"] = strings.Join(catCodes, ",")
|
||||
} else if len(catNames) > 0 {
|
||||
params["category_names"] = strings.Join(catNames, ",")
|
||||
}
|
||||
|
||||
if len(secondaryCatCodes) > 0 {
|
||||
params["secondary_category_codes"] = strings.Join(secondaryCatCodes, ",")
|
||||
} else if len(secondaryCatNames) > 0 {
|
||||
params["secondary_category_names"] = strings.Join(secondaryCatNames, ",")
|
||||
}
|
||||
|
||||
if len(foodCodes) > 0 {
|
||||
params["app_food_codes"] = strings.Join(foodCodes, ",")
|
||||
}
|
||||
_, err = a.AccessAPI2("retailCat/batchdelete/catandretail", false, params, resultKeyData, trackInfo)
|
||||
return err
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
// 私有辅助函数
|
||||
func interface2Cat(data interface{}, level int) (cat *RetailCategoryInfo) {
|
||||
|
||||
Reference in New Issue
Block a user