- get and cancel promotion

This commit is contained in:
gazebo
2018-11-05 15:08:30 +08:00
parent 34c74cd40a
commit cf4bfb3dd8
5 changed files with 326 additions and 35 deletions

View File

@@ -19,8 +19,8 @@ type PromotionController struct {
// @Param token header string true "认证token"
// @Param vendorID formData int true "厂商ID当前只支持京东0 "
// @Param name formData string true "促销名,必须唯一(所以名子上最好带上日期)"
// @Param beginAt formData string true "开始时间"
// @Param endAt formData string true "结束时间"
// @Param beginAt formData string true "开始日期"
// @Param endAt formData string true "结束日期"
// @Param type formData int true "促销类型3直降4限时抢购"
// @Param storeIDs formData string true "json数据storeID列表[1,2,3]"
// @Param skuPrices formData string true "json数据价格信息列表"
@@ -99,3 +99,43 @@ func (c *PromotionController) SendAdvertingByGoodsOrder() {
return retVal, "", err
})
}
// @Title 查询促销
// @Description 查询促销
// @Param token header string true "认证token"
// @Param keyword query string false "关键字"
// @Param vendorID query int false "厂商ID当前只支持京东0 "
// @Param promotionID query int false "活动id"
// @Param vendorPromotionID query int false "厂商活动id"
// @Param days query int false "多少天内创建的缺省7天"
// @Param name query string false "促销名,不完全匹配"
// @Param beginAt query string false "开始日期,包括"
// @Param endAt query string false "结束日期,包括"
// @Param type query int false "促销类型3直降4限时抢购"
// @Param storeID query int false "包含门店"
// @Param skuID query int false "包含sku"
// @Param offset query int false "活动列表起始序号以0开始缺省为0"
// @Param pageSize query int false "活动列表页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetPromotions [get]
func (c *PromotionController) GetPromotions() {
c.callGetPromotions(func(params *tPromotionGetPromotionsParams) (retVal interface{}, errCode string, err error) {
retVal, err = promotion.GetJdPromotions(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize)
return retVal, "", err
})
}
// @Title 查询促销
// @Description 查询促销
// @Param token header string true "认证token"
// @Param promotionID query int true "活动id"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CancelPomotion [put]
func (c *PromotionController) CancelPomotion() {
c.callCancelPomotion(func(params *tPromotionCancelPomotionParams) (retVal interface{}, errCode string, err error) {
err = promotion.CancelJdPromotion(params.Ctx, params.PromotionID)
return retVal, "", err
})
}