This commit is contained in:
苏尹岚
2020-09-11 17:31:07 +08:00
parent 17428c16d7
commit 6b19c53a76
5 changed files with 298 additions and 1 deletions

View File

@@ -529,3 +529,27 @@ func (a *API) InStoreCouponList(poiCode string, pageNum, pageSize int) (couponAc
}
return couponActList, err
}
type GetByAppPoiCodeAndTypeResult struct {
ActName string `json:"act_name"`
ActType int `json:"act_type"`
ActStatus int `json:"act_status"`
ActCount int `json:"act_count"`
ItemCount int `json:"item_count"`
StartTime int `json:"start_time"`
EndTime int `json:"end_time"`
}
// 查询门店内活动信息
// https://developer.waimai.meituan.com/home/docDetail/444
func (a *API) GetByAppPoiCodeAndType(appPoiCode string, status, actType int) (getByAppPoiCodeAndTypeResult []*GetByAppPoiCodeAndTypeResult, err error) {
result, err := a.AccessAPI("act/all/get/byAppPoiCodeAndType", true, map[string]interface{}{
KeyAppPoiCode: appPoiCode,
"status": status,
"type": actType,
})
if err == nil {
err = utils.Map2StructByJson(result, &getByAppPoiCodeAndTypeResult, false)
}
return getByAppPoiCodeAndTypeResult, err
}

View File

@@ -112,3 +112,11 @@ func TestParseErr4RetailDiscountDelete(t *testing.T) {
failedList := ParseErr4RetailDiscountDelete(errExt)
t.Log(utils.Format4Output(failedList, false))
}
func TestGetByAppPoiCodeAndType(t *testing.T) {
result, err := api.GetByAppPoiCodeAndType("9375120", 1, 1)
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}