jdim测试

This commit is contained in:
邹宗楠
2025-12-16 15:53:03 +08:00
parent a2025b5e6c
commit 2fc5eeaa19
2 changed files with 21 additions and 12 deletions

View File

@@ -249,15 +249,17 @@ 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))
if err != nil {
callbackResponse = jdapi.Err2CallbackResponse(err, "")
} else {
globals.SugarLogger.Debugf("-----url := %s", url)
globals.SugarLogger.Debugf("-----msg := %s", string(msg))
callbackResponse = jdapi.Err2CallbackResponse(im.ReadMsgFromVendor(model.VendorIDJD, url, msg), "")
callbackResponse = jdapi.Err2CallbackResponse(nil, "")
var base *jdapi.BaseInfo
if utils.Map2StructByJson(msg, &base, false); err == nil {
globals.SugarLogger.Debugf("-----url := %s", url)
globals.SugarLogger.Debugf("-----msg := %s", utils.Format4Output(msg, false))
callbackResponse = jdapi.Err2CallbackResponse(im.ReadMsgFromVendor(model.VendorIDJD, url, []byte(base.JdParamJson)), "")
callbackResponse = jdapi.Err2CallbackResponse(nil, "")
}
}
c.Data["json"] = c.transferResponse("orderStatus", callbackResponse)
c.ServeJSON()