切换主体

This commit is contained in:
ziming 2026-03-27 10:38:07 +08:00
parent 4be755c113
commit f1e813584f
1 changed files with 4 additions and 6 deletions

View File

@ -57,12 +57,10 @@ func (srv *NotifyService) Notify(ctx http.Context) error {
})
}
headerJson, _ := json.Marshal(headers)
log.Warnf("微信回调通知[%s],CallBack处理失败,headers:%s,body:%s", mchId, headerJson, string(bodyBytes))
bizData, err := srv.WechatBiz.CallBack(ctx, mchId, &headers, bodyBytes)
if err != nil {
log.Errorf("微信回调通知[%s],CallBack处理失败,headers:%s,body:%s,err:%s", mchId, headerJson, string(bodyBytes), err.Error())
headerJson, _ := json.Marshal(headers)
log.Errorf("微信回调通知[%s],callBack处理失败:%s\nheaders:%s\nbody:%s", mchId, err.Error(), headerJson, string(bodyBytes))
return ctx.JSON(http2.StatusNetworkAuthenticationRequired, map[string]string{
"code": "FAIL",
"message": err.Error(),
@ -72,8 +70,8 @@ func (srv *NotifyService) Notify(ctx http.Context) error {
ip := helper.GetClientIP(ctx)
if err = srv.VoucherBiz.WechatNotifyConsumer(ctx, ip, bizData); err != nil {
//log.Errorf("微信回调通知[%s],consumer处理失败:%s\nheaders:%s\nbody:%s\n解析数据:%+v", mchId, err.Error(), headerJson, string(bodyBytes), bizData)
log.Errorf("微信回调通知[%s],consumer处理失败[%s-%s-%s]", mchId, bizData.PlainText.StockID, bizData.PlainText.CouponID, err.Error())
headerJson, _ := json.Marshal(headers)
log.Errorf("微信回调通知[%s],consumer处理失败:%s\nheaders:%s\nbody:%s\n解析数据:%+v", mchId, err.Error(), headerJson, string(bodyBytes), bizData)
if errors.Is(err, gorm.ErrRecordNotFound) {
return ctx.JSON(http2.StatusOK, nil)