- prevent modify promotion sku

This commit is contained in:
gazebo
2018-11-06 16:10:23 +08:00
parent ae267dcdbe
commit e0cf85ebb6
4 changed files with 74 additions and 20 deletions

View File

@@ -4,6 +4,8 @@ import (
"net/http"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/promotion"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jd"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
@@ -99,7 +101,16 @@ func (c *DjswController) Token() {
}
func (c *DjswController) StockIsHave() {
globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
c.Data["json"] = jdapi.Err2CallbackResponse(nil, "")
c.ServeJSON()
// globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
if c.Ctx.Input.Method() == http.MethodPost {
obj, callbackResponse := api.JdAPI.GetStoreStockCallbackMsg(c.Ctx.Input.RequestBody)
if callbackResponse == nil {
globals.SugarLogger.Debugf("StockIsHave, obj:%s", utils.Format4Output(obj, false))
callbackResponse = promotion.OnStoreStockMsg(obj)
}
c.Data["json"] = callbackResponse
c.ServeJSON()
} else {
c.Abort("404")
}
}