- 添加京西活动,用于记录活动商品结算价格
This commit is contained in:
@@ -3,6 +3,8 @@ package controllers
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -17,7 +19,7 @@ type PromotionController struct {
|
||||
// @Title 创建活动
|
||||
// @Description 创建活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID formData int true "厂商ID,当前只支持京东:0 "
|
||||
// @Param vendorID formData int true "厂商ID,当前只支持,京东:0,京西(用于记录活动信息):99"
|
||||
// @Param name formData string true "活动名,必须唯一(所以名子上最好带上日期)"
|
||||
// @Param beginAt formData string true "开始日期"
|
||||
// @Param endAt formData string true "结束日期"
|
||||
@@ -57,7 +59,7 @@ func (c *PromotionController) CreatePromotion() {
|
||||
}
|
||||
if err = utils.UnmarshalUseNumber([]byte(params.StoreIDs), &promotionParams.StoreIDs); err == nil {
|
||||
if err = utils.UnmarshalUseNumber([]byte(params.SkuPrices), &promotionParams.SkuPrices); err == nil {
|
||||
retVal, err = promotion.CreateJdPromotion(params.Ctx, false, params.IsAsync, params.IsContinueWhenError, params.VendorPromotionID, promotionParams, params.MapData)
|
||||
retVal, err = promotion.CreateJdPromotion(params.Ctx, params.VendorID, false, params.IsAsync, params.IsContinueWhenError, params.VendorPromotionID, promotionParams, params.MapData)
|
||||
}
|
||||
}
|
||||
return retVal, "", err
|
||||
@@ -177,6 +179,24 @@ func (c *PromotionController) LockPromotionSkus() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 修改活动商品门店结算价
|
||||
// @Description 修改活动商品门店结算价
|
||||
// @Param token header string true "认证token"
|
||||
// @Param promotionID formData int true "活动id"
|
||||
// @Param skuPrices formData string true "json数据,价格信息列表(只有EarningPrice有效)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /UpdatePromotionSkusEarningPrice [put]
|
||||
func (c *PromotionController) UpdatePromotionSkusEarningPrice() {
|
||||
c.callUpdatePromotionSkusEarningPrice(func(params *tPromotionUpdatePromotionSkusEarningPriceParams) (retVal interface{}, errCode string, err error) {
|
||||
var skuPriceList []*promotion.SkuPrice
|
||||
if err = jxutils.Strings2Objs(params.SkuPrices, &skuPriceList); err == nil {
|
||||
retVal, err = promotion.UpdatePromotionSkusEarningPrice(params.Ctx, params.PromotionID, skuPriceList)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 从远程更新活动状态
|
||||
// @Description 从远程更新活动状态
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
Reference in New Issue
Block a user