- weimob order callback
This commit is contained in:
@@ -2,7 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasks"
|
||||
_ "git.rosy.net.cn/jx-callback/business/partner/purchase/weimob/wsc"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/weimob/wsc"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
@@ -12,9 +12,17 @@ type WeimobController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
func (c *WeimobController) onCallbackMsg(msgType string) {
|
||||
c.Data["json"] = "ok"
|
||||
c.ServeJSON()
|
||||
func (c *WeimobController) onCallbackMsg() {
|
||||
if true { //c.Ctx.Input.Method() == http.MethodPost {
|
||||
msg, callbackResponse := api.WeimobAPI.GetCallbackMsg(c.Ctx.Input.RequestBody)
|
||||
if callbackResponse == nil {
|
||||
callbackResponse = wsc.OnCallbackMsg(msg)
|
||||
}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *WeimobController) Code() {
|
||||
@@ -30,3 +38,11 @@ func (c *WeimobController) Code() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *WeimobController) CreateOrder() {
|
||||
c.onCallbackMsg()
|
||||
}
|
||||
|
||||
func (c *WeimobController) OrderStatusChange() {
|
||||
c.onCallbackMsg()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user