mtwmapi.ParseErr4RetailDiscountDelete
This commit is contained in:
@@ -175,6 +175,11 @@ type CouponActInfo struct {
|
||||
Status int `json:"status"` // 活动状态
|
||||
}
|
||||
|
||||
type ActItemErrMsg struct {
|
||||
ActID int64 `json:"act_id"`
|
||||
ErrorMsg string `json:"error_msg"`
|
||||
}
|
||||
|
||||
// 批量创建指定商品满减活动或创建店内满减活动
|
||||
// http://developer.waimai.meituan.com/home/docDetail/255
|
||||
func (a *API) FullDiscountBatchSave(poiCode string, actInfo *FullDiscountActInfo, actList []*FullDiscountActDetail, actSkuList []*FullDiscountSku) (actIDList []int64, err error) {
|
||||
@@ -318,15 +323,19 @@ func (a *API) FulllDiscountShippingFeeBatchDelete(poiCode string, actIDList []st
|
||||
|
||||
// 批量创建或更新零售折扣商品
|
||||
// http://developer.waimai.meituan.com/home/docDetail/287
|
||||
func (a *API) RetailDiscountBatchSave(poiCode string, actData []*RetailDiscountActData) (actResult []*RetailDiscountActResult, err error) {
|
||||
func (a *API) RetailDiscountBatchSave(poiCode string, actData []*RetailDiscountActData) (actResult []*RetailDiscountActResult /*failedList []*AppFoodResult, */, err error) {
|
||||
result, err := a.AccessAPI2("act/retail/discount/batchsave", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"act_data": string(utils.MustMarshal(actData)),
|
||||
}, resultKeySuccessMsg, "")
|
||||
}, "", "")
|
||||
if err == nil {
|
||||
err = utils.UnmarshalUseNumber([]byte(result.(string)), &actResult)
|
||||
resultMap := result.(map[string]interface{})
|
||||
err = utils.UnmarshalUseNumber([]byte(resultMap[resultKeySuccessMsg].(string)), &actResult)
|
||||
// if err == nil {
|
||||
// failedList, err = handleRetailBatchResult(resultMap[resultKeyMsg])
|
||||
// }
|
||||
}
|
||||
return actResult, err
|
||||
return actResult /*failedList, */, err
|
||||
}
|
||||
|
||||
// 查询门店零售折扣商品
|
||||
@@ -367,6 +376,16 @@ func (a *API) RetailDiscountDelete(poiCode string, actIDList []string) (err erro
|
||||
return err
|
||||
}
|
||||
|
||||
func ParseErr4RetailDiscountDelete(err error) (failedList []*ActItemErrMsg) {
|
||||
if errExt, ok := err.(*utils.ErrorWithCode); ok {
|
||||
var mapData map[string]interface{}
|
||||
if err := utils.UnmarshalUseNumber([]byte(errExt.ErrMsg()), &mapData); err == nil {
|
||||
utils.Map2StructByJson(mapData["error_list"], &failedList, false)
|
||||
}
|
||||
}
|
||||
return failedList
|
||||
}
|
||||
|
||||
// 批量修改零售折扣商品当日活动库存
|
||||
// http://developer.waimai.meituan.com/home/docDetail/290
|
||||
func (a *API) RetailDiscountBatchStock(poiCode, actDataList []*RetailDiscountActDataLimit) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user