- OnNewPromotionMsg
This commit is contained in:
@@ -872,6 +872,14 @@ func OnStoreStockMsg(msg *jdapi.CallbackStoreStockMsg) (retVal *jdapi.CallbackRe
|
||||
return jdapi.Err2CallbackResponse(err, "")
|
||||
}
|
||||
|
||||
func OnNewPromotionMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
result, err := api.JdAPI.QueryPromotionInfo(utils.Str2Int64(msg.BillID))
|
||||
if err == nil {
|
||||
globals.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
}
|
||||
return jdapi.Err2CallbackResponse(err, "")
|
||||
}
|
||||
|
||||
func excelStr2Time(timeStr string) (tm time.Time, err error) {
|
||||
return time.ParseInLocation("2006年1月2日15点4分5秒", timeStr, time.Local)
|
||||
}
|
||||
|
||||
@@ -116,7 +116,14 @@ func (c *DjswController) StockIsHave() {
|
||||
}
|
||||
|
||||
func (c *DjswController) SinglePromoteCreate() {
|
||||
globals.SugarLogger.Info(string(c.Ctx.Input.RequestBody))
|
||||
c.Data["json"] = jdapi.Err2CallbackResponse(nil, "")
|
||||
c.ServeJSON()
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
obj, callbackResponse := api.JdAPI.GetOrderCallbackMsg(c.Ctx.Input.RequestBody)
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = promotion.OnNewPromotionMsg(obj)
|
||||
}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user