+mtwmapi.RetailDiscountBatchSave2
This commit is contained in:
@@ -12,6 +12,9 @@ const (
|
||||
|
||||
RetailActTypeDirectDown = 1001 // 折扣活动
|
||||
RetailActTypeSecKill = 56 // 爆品活动
|
||||
|
||||
MaxRetailDiscountCreateBatchSize = 200
|
||||
MaxRetailDiscountDeleteBatchSize = 100
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -345,6 +348,25 @@ func (a *API) RetailDiscountBatchSave(poiCode string, actType int, actData []*Re
|
||||
return actResult /*failedList, */, err
|
||||
}
|
||||
|
||||
func (a *API) RetailDiscountBatchSave2(poiCode string, actType int, actData []*RetailDiscountActData) (actResult []*RetailDiscountActResult, failedList []*AppFoodResult, err error) {
|
||||
if actType == 0 {
|
||||
actType = RetailActTypeDirectDown
|
||||
}
|
||||
result, err := a.AccessAPI2("act/retail/discount/batchsave", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"act_data": string(utils.MustMarshal(actData)),
|
||||
"act_type": actType,
|
||||
}, "", "")
|
||||
if err == nil {
|
||||
resultMap := result.(map[string]interface{})
|
||||
err = utils.UnmarshalUseNumber([]byte(resultMap[resultKeySuccessMsg].(string)), &actResult)
|
||||
if err == nil {
|
||||
failedList, err = handleRetailBatchResult(resultMap[resultKeyMsg])
|
||||
}
|
||||
}
|
||||
return actResult, failedList, err
|
||||
}
|
||||
|
||||
// 查询门店零售折扣商品
|
||||
// http://developer.waimai.meituan.com/home/docDetail/288
|
||||
func (a *API) RetailDiscountList(poiCode string, actType int) (actList []*RetailDiscountActData, err error) {
|
||||
@@ -379,6 +401,7 @@ func (a *API) RetailDiscountList(poiCode string, actType int) (actList []*Retail
|
||||
|
||||
// 批量删除零售折扣商品
|
||||
// http://developer.waimai.meituan.com/home/docDetail/289
|
||||
// TODO 部分成功未处理
|
||||
func (a *API) RetailDiscountDelete(poiCode string, actType int, actIDList []string) (err error) {
|
||||
if actType == 0 {
|
||||
actType = RetailActTypeDirectDown
|
||||
|
||||
Reference in New Issue
Block a user