From 9134992c7670564034500dcd456f73fcc04d8b67 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 19 Aug 2023 10:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consume/zhios_fast_return_order_pay.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/consume/zhios_fast_return_order_pay.go b/consume/zhios_fast_return_order_pay.go index 1388108..a42bdfe 100644 --- a/consume/zhios_fast_return_order_pay.go +++ b/consume/zhios_fast_return_order_pay.go @@ -44,9 +44,17 @@ func ZhiosFastReturnOrderPay(queue md.MqQueue) { if err == nil { _ = res.Ack(true) } else { - var msg *md.ZhiosFatReturnOrderPay - json.Unmarshal(res.Body, &msg) - ch.Publish(queue.ExchangeName, msg, queue.RoutKey) + var canalMsg *md.ZhiosFatReturnOrderPay + var tmpString string + err := json.Unmarshal(res.Body, &tmpString) + if err == nil { + fmt.Println(tmpString) + err = json.Unmarshal([]byte(tmpString), &canalMsg) + if err == nil { + ch.Publish(queue.ExchangeName, utils.SerializeStr(canalMsg), queue.RoutKey) + } + } + } } else { panic(errors.New("error getting message"))