From 108331994aac69fb4e51f743d9060e8bd63ac29f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 9 Dec 2024 14:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consume/jpush_record_consume.go | 5 +++-- consume/md/mq_jpush.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/consume/jpush_record_consume.go b/consume/jpush_record_consume.go index e1507e5..96bf733 100644 --- a/consume/jpush_record_consume.go +++ b/consume/jpush_record_consume.go @@ -52,6 +52,7 @@ func JpushRecordConsume(queue md.MqQueue) { //TODO::重新推回队列末尾,避免造成队列堵塞 var msg *md.JpushRecordFundData json.Unmarshal(res.Body, &msg) + msg.Num = "1" ch.Publish(queue.ExchangeName, msg, queue.RoutKey) } else { //_ = res.Reject(false) @@ -81,12 +82,12 @@ func handleJpushRecordConsume(msgData []byte) error { jpushSecret := sysCfgDb.SysCfgGetWithDb("jpush_secret") if msg.Target == "0" { //广播全部 _, err := jPush.PushAllUser(jpushKey, jpushSecret, msg.Title, msg.Content, msg.Platform, nil) - if err != nil { + if err != nil && msg.Num != "1" { return err } } else { _, err = jPush.PushMoreUser(jpushKey, jpushSecret, msg.Title, msg.Content, msg.Platform, strings.Split(msg.UserId, ","), nil) - if err != nil { + if err != nil && msg.Num != "1" { return err } } diff --git a/consume/md/mq_jpush.go b/consume/md/mq_jpush.go index 90f2b52..afaf7b2 100644 --- a/consume/md/mq_jpush.go +++ b/consume/md/mq_jpush.go @@ -7,6 +7,7 @@ type JpushRecordFundData struct { Content string `json:"content"` Platform string `json:"platform"` Target string `json:"target"` + Num string `json:"num"` } type AliyunSmsRecordFundData struct { Id string `json:"id"`