|
@@ -216,15 +216,19 @@ func LotteryDrawTask(msg *model.Message) {
|
|
|
userName = string(phone[0:3]) + "****" + string(phone[(len(phone)-4):])
|
|
|
}
|
|
|
}
|
|
|
- //util.SendNotification(msgBody.UserId, model.SseMessage{
|
|
|
- util.SendNotificationToAll(model.SseMessage{
|
|
|
- Name: taskInfo.Name,
|
|
|
- User: encrypt.SE.EncodeString(msgBody.UserId),
|
|
|
- State: model.TaskTarget,
|
|
|
- Time: time.Now().Format(date.Date_Full_Layout),
|
|
|
- Remark: fmt.Sprintf("%s 完成 %s 任务。", userName, taskInfo.Name),
|
|
|
- ActiveId: encrypt.SE.EncodeString(strconv.FormatInt(msgBody.ActiveId, 10)),
|
|
|
- })
|
|
|
+ if sendData := util.GetSseRedisCache(msgBody.UserId); len(sendData) > 0 {
|
|
|
+ for _, sv := range sendData {
|
|
|
+ util.SendNotification(sv, model.SseMessage{
|
|
|
+ //util.SendNotificationToAll(model.SseMessage{
|
|
|
+ Name: taskInfo.Name,
|
|
|
+ User: encrypt.SE.EncodeString(msgBody.UserId),
|
|
|
+ State: model.TaskTarget,
|
|
|
+ Time: time.Now().Format(date.Date_Full_Layout),
|
|
|
+ Remark: fmt.Sprintf("%s 完成 %s 任务。", userName, taskInfo.Name),
|
|
|
+ ActiveId: encrypt.SE.EncodeString(strconv.FormatInt(msgBody.ActiveId, 10)),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|