1
This commit is contained in:
@@ -250,23 +250,24 @@ func (c *DjswController) OrderInvoice() {
|
||||
|
||||
func (c *DjswController) imMsg() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
var callbackResponse *jdapi.CallbackResponse
|
||||
msg, url, err := jdapi.ImChatRiskMsg(getUsefulRequest(c.Ctx))
|
||||
globals.SugarLogger.Debugf("-----------jdmsg := %s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("-----------jdmsg URL:= %s", url)
|
||||
if err != nil {
|
||||
callbackResponse = jdapi.Err2CallbackResponse(err, "")
|
||||
} else {
|
||||
if err == nil {
|
||||
var base *jdapi.BaseInfo
|
||||
if utils.UnmarshalUseNumber(msg, &base); err == nil {
|
||||
if url == "msgReadAck" || url == "chatRiskMsg" {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", fmt.Sprintf("jdIm:%s消息推送", url), utils.Format4Output(msg, false))
|
||||
}
|
||||
callbackResponse = jdapi.Err2CallbackResponse(im.ReadMsgFromVendor(model.VendorIDJD, url, []byte(base.JdParamJson)), "")
|
||||
callbackResponse = jdapi.Err2CallbackResponse(nil, "")
|
||||
err = im.ReadMsgFromVendor(model.VendorIDJD, url, []byte(base.JdParamJson))
|
||||
}
|
||||
}
|
||||
c.Data["json"] = c.transferResponse("orderStatus", callbackResponse)
|
||||
|
||||
if err != nil {
|
||||
c.Data["json"] = -1
|
||||
} else {
|
||||
c.Data["json"] = 0
|
||||
}
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
c.Abort("404")
|
||||
|
||||
Reference in New Issue
Block a user