- 确认京东单品活动接口,在活动确认后,能删除活动商品,但不能添加
This commit is contained in:
@@ -184,6 +184,7 @@ func (a *API) createPromotionRules(promotionType int, infoId int64, outInfoId st
|
||||
}
|
||||
|
||||
// todo skusResult 返回值没有意义,为了兼容暂时保留
|
||||
// 此接口在活动确认后不能调用
|
||||
func (a *API) createPromotionSku(promotionType int, infoId int64, outInfoId string, skus []*PromotionSku, traceId string) (skusResult []*PromotionSku, err error) {
|
||||
jdParams := getCommonSkuPromotionParams(infoId, outInfoId, traceId)
|
||||
jdParams["skus"] = skus
|
||||
@@ -201,6 +202,7 @@ func (a *API) confirmPromotion(promotionType int, infoId int64, outInfoId, trace
|
||||
return err
|
||||
}
|
||||
|
||||
// 与createPromotionSku不同的是,此接口在活动确认后可以合适,实时生效
|
||||
func (a *API) cancelPromotionSku(promotionType int, infoId int64, outInfoId string, cancelSkus []*PromotionSku, traceId string) (err error) {
|
||||
jdParams := getCommonSkuPromotionParams(infoId, outInfoId, traceId)
|
||||
jdParams["cancelSkus"] = cancelSkus
|
||||
|
||||
@@ -3,6 +3,8 @@ package jdapi
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func TestCreatePromotionSingle(t *testing.T) {
|
||||
@@ -60,3 +62,17 @@ func TestCreatePromotionLimitTime(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreatePromotionSkuLimitTime(t *testing.T) {
|
||||
_, err := api.CreatePromotionSkuLimitTime(67854209, "", []*PromotionSku{
|
||||
&PromotionSku{
|
||||
OutStationNo: "2",
|
||||
OutSkuID: "2142",
|
||||
PromotionPrice: 300,
|
||||
LimitSkuCount: 200,
|
||||
},
|
||||
}, utils.Int64ToStr(time.Now().Unix()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user