|
|
@@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|