Просмотр исходного кода

fix:推送err失败信息处理

duxin 1 год назад
Родитель
Сommit
8fe1548882
1 измененных файлов с 9 добавлено и 4 удалено
  1. 9 4
      rpc/internal/logic/appletterpushlogic.go

+ 9 - 4
rpc/internal/logic/appletterpushlogic.go

@@ -57,11 +57,16 @@ func (l *AppLetterPushLogic) AppLetterPush(in *message.WxTmplMsgRequest) (*messa
 			rData, _ := entity.MQFW.FindOneByField("user", query, fmt.Sprintf(`{"_id":1,"s_appponetype":1,"s_appversion":1,"s_nmae":1,"s_nmae":1,"s_jpushid":1,"s_opushid":1,"s_m_openid":1,"o_pushset.%s.i_apppush":1}`, pushConfig.Switch))
 			if rData != nil && len(*rData) > 0 {
 				userData = *rData
-			}
-
-			if err = common.AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title, in.Detail); err != nil {
+				if err = common.AppPushMsg(userData, pushConfig.Switch, in.Url, in.Title, in.Detail); err != nil {
+					return &message.SendMsgResponse{
+						Total:   0,
+						Message: err.Error(),
+					}, err
+				}
+			} else {
 				return &message.SendMsgResponse{
-					Total: 1,
+					Total:   0,
+					Message: "查询用户信息失败",
 				}, err
 			}
 		}