From 9153e9a70985021f01cb306882aafbf9de77e6d6 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 5 Dec 2024 14:25:59 +0800 Subject: [PATCH] update --- app/svc/im/svc_send_message.go | 12 ++++++------ app/task/svc/svc_egg_energy_deal_fund_data.go | 4 ++-- .../svc/svc_egg_energy_deal_platform_revenue_data.go | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/svc/im/svc_send_message.go b/app/svc/im/svc_send_message.go index c111da6..b91f261 100644 --- a/app/svc/im/svc_send_message.go +++ b/app/svc/im/svc_send_message.go @@ -99,7 +99,7 @@ func DealGroupMessage(recordID int, req *md.BatchSendGroupMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) // 1.3 记录推送的群ID groupIDs = append(groupIDs, utils.Int64ToStr(groupWithOwner.GroupID)) } @@ -140,7 +140,7 @@ func DealGroupMessage(recordID int, req *md.BatchSendGroupMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) groupIDs = sendCondition } } else if len(notCondition) != 0 && len(sendCondition) == 0 { @@ -163,7 +163,7 @@ func DealGroupMessage(recordID int, req *md.BatchSendGroupMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) // 1.3 记录推送的群ID groupIDs = append(groupIDs, utils.Int64ToStr(groupUser.GroupId)) } @@ -229,7 +229,7 @@ func DealUserMessage(recordID int, req *md.BatchSendUserMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) // 1.3 记录推送的用户IM ID userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID)) } @@ -277,7 +277,7 @@ func DealUserMessage(recordID int, req *md.BatchSendUserMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) // 1.3 记录推送的群ID userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID)) } @@ -335,7 +335,7 @@ func DealUserMessage(recordID int, req *md.BatchSendUserMessageReq) { Content: req.Content, } // 1.2 逐个推送到 mq - ch.Publish(md2.IMEggEnergyExchange, data, md2.IMEggEnergyRoutKeyForBatchSendMessageData) + ch.Publish(md2.IMEggEnergyExchange, utils.SerializeStr(data), md2.IMEggEnergyRoutKeyForBatchSendMessageData) // 1.3 记录推送的用户IM ID userIMIDs = append(userIMIDs, utils.Int64ToStr(customerServiceWithUser.UserIMID)) } diff --git a/app/task/svc/svc_egg_energy_deal_fund_data.go b/app/task/svc/svc_egg_energy_deal_fund_data.go index dbe56d2..245648c 100644 --- a/app/task/svc/svc_egg_energy_deal_fund_data.go +++ b/app/task/svc/svc_egg_energy_deal_fund_data.go @@ -79,9 +79,9 @@ func EggEnergyDealFundData(eg *xorm.Engine) { amount := totalAmount.Div(times) // 4、推入rabbitmq 异步处理 - ch.Publish(md2.EggEnergyExchange, md2.EggEnergyStructForEggEnergyFundData{ + ch.Publish(md2.EggEnergyExchange, utils.SerializeStr(md2.EggEnergyStructForEggEnergyFundData{ ID: data.Id, Amount: amount.String(), - }, md2.EggEnergyRoutKeyForEggEnergyFundData) + }), md2.EggEnergyRoutKeyForEggEnergyFundData) } } diff --git a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go index 3002959..69b532b 100644 --- a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go +++ b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go @@ -79,9 +79,9 @@ func EggEnergyDealPlatformRevenueData(eg *xorm.Engine) { amount := totalAmount.Div(times) // 4、推入rabbitmq 异步处理 - ch.Publish(md2.EggEnergyExchange, md2.EggEnergyStructForPlatformRevenueData{ + ch.Publish(md2.EggEnergyExchange, utils.SerializeStr(md2.EggEnergyStructForPlatformRevenueData{ ID: data.Id, Amount: amount.String(), - }, md2.EggEnergyRoutKeyForPlatformRevenueData) + }), md2.EggEnergyRoutKeyForPlatformRevenueData) } }