+ globals.EnableNewAct

This commit is contained in:
gazebo
2019-07-15 14:19:38 +08:00
parent 82ad1ed0cc
commit 598a9738e8
4 changed files with 21 additions and 2 deletions

View File

@@ -126,7 +126,11 @@ func (c *DjswController) SinglePromoteCreate() {
if c.Ctx.Input.Method() == http.MethodPost {
obj, callbackResponse := api.JdAPI.GetOrderCallbackMsg(getUsefulRequest(c.Ctx))
if callbackResponse == nil {
callbackResponse = promotion.OnNewPromotionMsg(obj)
if globals.EnableNewAct {
callbackResponse = jd.OnActMsg(obj)
} else {
callbackResponse = promotion.OnNewPromotionMsg(obj)
}
}
c.Data["json"] = c.transferResponse("SinglePromoteCreate", callbackResponse)
c.ServeJSON()

View File

@@ -1,7 +1,11 @@
package controllers
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
@@ -36,6 +40,11 @@ type PromotionController struct {
// @router /CreatePromotion [post]
func (c *PromotionController) CreatePromotion() {
c.callCreatePromotion(func(params *tPromotionCreatePromotionParams) (retVal interface{}, errCode string, err error) {
if globals.EnableNewAct {
if params.VendorID == model.VendorIDJD {
return retVal, "", fmt.Errorf("请使用新版活动管理创建平台活动")
}
}
beginAt, err := utils.TryStr2Time(params.BeginAt)
if err != nil {
return retVal, "", err