- dingding callback msg
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
@@ -15,14 +19,16 @@ func init() {
|
||||
|
||||
func (c *DingDingController) Msg() {
|
||||
globals.SugarLogger.Debugf("dingding msg:%s", string(c.Ctx.Input.RequestBody))
|
||||
// if c.Ctx.Input.Method() == http.MethodPost {
|
||||
// obj, callbackResponse := api.EbaiAPI.GetCallbackMsg(c.Ctx.Request)
|
||||
// if callbackResponse == nil {
|
||||
// callbackResponse = ebai.OnCallbackMsg(obj)
|
||||
// }
|
||||
// c.Data["json"] = callbackResponse
|
||||
// c.ServeJSON()
|
||||
// } else {
|
||||
// c.Abort("404")
|
||||
// }
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
dataMap := utils.URLValues2Map(c.Ctx.Request.Form)
|
||||
obj, callbackResponse := api.DingDingAPI.GetCallbackMsg(dataMap, c.Ctx.Input.RequestBody)
|
||||
if callbackResponse == nil {
|
||||
globals.SugarLogger.Debugf("dingding msg, obj:%s", utils.Format4Output(obj, false))
|
||||
callbackResponse = api.DingDingAPI.Err2CallbackResponse(nil)
|
||||
}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user