This commit is contained in:
苏尹岚
2021-01-11 15:45:11 +08:00
parent c5b66cfd3b
commit b206fa3cc7
3 changed files with 43 additions and 2 deletions

View File

@@ -327,3 +327,24 @@ func (c *JxOrderController) AddCoupons() {
return retVal, "", err
})
}
// @Title 修改优惠券
// @Description 修改优惠券
// @Param token header string true "认证token"
// @Param payload formData string true "优惠券类型 payload"
// @Param storeIDs formData string false "门店IDs"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateCoupons [post]
func (c *JxOrderController) UpdateCoupons() {
c.callUpdateCoupons(func(params *tJxorderUpdateCouponsParams) (retVal interface{}, errCode string, err error) {
payload := make(map[string]interface{})
var storeIDs []int
if err = utils.UnmarshalUseNumber([]byte(params.Payload), &payload); err == nil {
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err == nil {
err = localjx.UpdateCoupons(params.Ctx, payload, storeIDs)
}
}
return retVal, "", err
})
}