From c2bcd15c4cc466c80f428def60d3e8c4e1f5bd3f Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 4 Jul 2019 15:19:02 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E7=A1=AE=E8=AE=A4=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E5=8D=95=E5=93=81=E6=B4=BB=E5=8A=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E6=B4=BB=E5=8A=A8=E7=A1=AE=E8=AE=A4=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=83=BD=E5=88=A0=E9=99=A4=E6=B4=BB=E5=8A=A8=E5=95=86=E5=93=81?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E4=B8=8D=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdapi/promotion_sku.go | 2 ++ platformapi/jdapi/promotion_sku_test.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/platformapi/jdapi/promotion_sku.go b/platformapi/jdapi/promotion_sku.go index 1af0e9a1..e925ba81 100644 --- a/platformapi/jdapi/promotion_sku.go +++ b/platformapi/jdapi/promotion_sku.go @@ -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 diff --git a/platformapi/jdapi/promotion_sku_test.go b/platformapi/jdapi/promotion_sku_test.go index 8a8a4975..de1865b1 100644 --- a/platformapi/jdapi/promotion_sku_test.go +++ b/platformapi/jdapi/promotion_sku_test.go @@ -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) + } +}