diff --git a/business/jxstore/promotion/jd_promotion.go b/business/jxstore/promotion/jd_promotion.go index 9bcc4610c..423bc7f62 100644 --- a/business/jxstore/promotion/jd_promotion.go +++ b/business/jxstore/promotion/jd_promotion.go @@ -233,12 +233,12 @@ func Init() { } func CreateJdPromotion(ctx *jxcontext.Context, vendorID int, isIDJd bool, isAsync, isContinueWhenError bool, vendorPromotionID string, params *PromotionParams, mapData map[string]interface{}) (hint string, err error) { - if vendorPromotionID != "" && len(vendorPromotionID) != len("14863853") { - return "", fmt.Errorf("%s看起来不像是一个有效的京东活动ID,请仔细检查一下", vendorPromotionID) - } if vendorID != model.VendorIDJD && vendorID != model.VendorIDJX { return "", fmt.Errorf("当前只支持京西与京东活动") } + if vendorPromotionID != "" && len(vendorPromotionID) != len("14863853") { + return "", fmt.Errorf("%s看起来不像是一个有效的京东活动ID,请仔细检查一下", vendorPromotionID) + } if len(params.SkuPrices) == 0 { return "", ErrEmptySkus } diff --git a/controllers/promotion.go b/controllers/promotion.go index ef8321bd2..f4773d3d9 100644 --- a/controllers/promotion.go +++ b/controllers/promotion.go @@ -1,15 +1,12 @@ package controllers import ( - "errors" - "git.rosy.net.cn/jx-callback/business/jxutils" "github.com/astaxie/beego" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/business/jxstore/promotion" - "git.rosy.net.cn/jx-callback/business/model" ) type PromotionController struct { @@ -39,9 +36,6 @@ type PromotionController struct { // @router /CreatePromotion [post] func (c *PromotionController) CreatePromotion() { c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) { - if params.VendorID != model.VendorIDJD { - return nil, "", errors.New("当前只支持创建京东活动") - } beginAt, err := utils.TryStr2Time(params.BeginAt) if err != nil { return retVal, "", err