From e5510db6eabbcc7ea7a10c689d9e6d5ebdee90cc Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 7 Nov 2018 14:47:09 +0800 Subject: [PATCH] - check vendorPromotionID in CreateJdPromotion --- business/jxstore/promotion/jd_promotion.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/business/jxstore/promotion/jd_promotion.go b/business/jxstore/promotion/jd_promotion.go index b99f20bc7..08fe9bb79 100644 --- a/business/jxstore/promotion/jd_promotion.go +++ b/business/jxstore/promotion/jd_promotion.go @@ -199,6 +199,9 @@ func Init() { } func CreateJdPromotion(ctx *jxcontext.Context, isIDJd bool, isAsync, isContinueWhenError bool, vendorPromotionID string, params *PromotionParams, userName string) (hint string, err error) { + if vendorPromotionID != "" && len(vendorPromotionID) != len("14863853") { + return "", fmt.Errorf("%s看起来不像是一个有效的京东活动ID,请仔细检查一下", vendorPromotionID) + } if len(params.SkuPrices) == 0 { return "", ErrEmptySkus }