|
@@ -153,7 +153,8 @@ func (l *MiniSubscribeLogic) ReplyComment(conn transaction.Conn, article *domain |
|
@@ -153,7 +153,8 @@ func (l *MiniSubscribeLogic) ReplyComment(conn transaction.Conn, article *domain |
153
|
msg.ToUser = openId
|
153
|
msg.ToUser = openId
|
154
|
msg.Page = fmt.Sprintf("/pages/detail/more-comment?id=%v", article.Id) //跳转页面 帖子评论聚合页
|
154
|
msg.Page = fmt.Sprintf("/pages/detail/more-comment?id=%v", article.Id) //跳转页面 帖子评论聚合页
|
155
|
//备注
|
155
|
//备注
|
156
|
- msg.Data["thing9"] = &subscribe.DataItem{Value: fmt.Sprintf("您的帖子最近已有%v人评论,点击查看详情", article.CountComment)}
|
156
|
+ userCount, _ := l.svcCtx.ArticleCommentRepository.CommentUserCount(l.ctx, conn, comment.CompanyId, comment.ArticleId)
|
|
|
157
|
+ msg.Data["thing9"] = &subscribe.DataItem{Value: fmt.Sprintf("您的帖子最近已有%v人评论,点击查看详情", userCount)}
|
157
|
//发送微信订阅消息
|
158
|
//发送微信订阅消息
|
158
|
err = subCtx.Send(msg)
|
159
|
err = subCtx.Send(msg)
|
159
|
err = l.saveAndDecrease(conn, comment.CompanyId, article.AuthorId, domain.SubscribeTypeReplyComment, msg, err)
|
160
|
err = l.saveAndDecrease(conn, comment.CompanyId, article.AuthorId, domain.SubscribeTypeReplyComment, msg, err)
|
|
@@ -168,9 +169,9 @@ func (l *MiniSubscribeLogic) ReplyComment(conn transaction.Conn, article *domain |
|
@@ -168,9 +169,9 @@ func (l *MiniSubscribeLogic) ReplyComment(conn transaction.Conn, article *domain |
168
|
msg.ToUser = toOpenId
|
169
|
msg.ToUser = toOpenId
|
169
|
msg.Page = fmt.Sprintf("/pages/detail/reply-comment?id=%v&commentId=%v", article.Id, comment.Pid) //跳转页面评论聚合页
|
170
|
msg.Page = fmt.Sprintf("/pages/detail/reply-comment?id=%v&commentId=%v", article.Id, comment.Pid) //跳转页面评论聚合页
|
170
|
//备注
|
171
|
//备注
|
171
|
- parent, err := l.svcCtx.ArticleCommentRepository.FindOne(l.ctx, conn, comment.Pid)
|
|
|
172
|
- if err == nil && parent.Id > 0 {
|
|
|
173
|
- msg.Data["thing9"] = &subscribe.DataItem{Value: fmt.Sprintf("您的评论最近已有%v人回复,点击查看详情", parent.CountReply)}
|
172
|
+ replyCount, err := l.svcCtx.ArticleCommentRepository.ReplyUserCount(l.ctx, conn, comment.CompanyId, comment.Pid)
|
|
|
173
|
+ if err == nil {
|
|
|
174
|
+ msg.Data["thing9"] = &subscribe.DataItem{Value: fmt.Sprintf("您的评论最近已有%v人回复,点击查看详情", replyCount)}
|
174
|
//发送微信订阅消息
|
175
|
//发送微信订阅消息
|
175
|
err = subCtx.Send(msg)
|
176
|
err = subCtx.Send(msg)
|
176
|
err = l.saveAndDecrease(conn, comment.CompanyId, comment.ToUserId, domain.SubscribeTypeReplyComment, msg, err)
|
177
|
err = l.saveAndDecrease(conn, comment.CompanyId, comment.ToUserId, domain.SubscribeTypeReplyComment, msg, err)
|
|
@@ -210,6 +211,10 @@ func (l *MiniSubscribeLogic) LikeArticle(conn transaction.Conn, article *domain. |
|
@@ -210,6 +211,10 @@ func (l *MiniSubscribeLogic) LikeArticle(conn transaction.Conn, article *domain. |
210
|
if err != nil || openId == "" {
|
211
|
if err != nil || openId == "" {
|
211
|
return nil
|
212
|
return nil
|
212
|
}
|
213
|
}
|
|
|
214
|
+ newArticle, err := l.svcCtx.ArticleRepository.FindOne(l.ctx, conn, article.Id)
|
|
|
215
|
+ if err != nil {
|
|
|
216
|
+ return xerr.NewErrMsgErr("未获取到帖子信息", err)
|
|
|
217
|
+ }
|
213
|
msg := &subscribe.Message{
|
218
|
msg := &subscribe.Message{
|
214
|
ToUser: openId,
|
219
|
ToUser: openId,
|
215
|
TemplateID: domain.SubscribeTemplateLike,
|
220
|
TemplateID: domain.SubscribeTemplateLike,
|
|
@@ -222,7 +227,7 @@ func (l *MiniSubscribeLogic) LikeArticle(conn transaction.Conn, article *domain. |
|
@@ -222,7 +227,7 @@ func (l *MiniSubscribeLogic) LikeArticle(conn transaction.Conn, article *domain. |
222
|
//动态内容
|
227
|
//动态内容
|
223
|
"thing8": &subscribe.DataItem{Value: article.GetSubscribeMessageTitle()},
|
228
|
"thing8": &subscribe.DataItem{Value: article.GetSubscribeMessageTitle()},
|
224
|
//被赞次数
|
229
|
//被赞次数
|
225
|
- "number4": &subscribe.DataItem{Value: article.CountLove},
|
230
|
+ "number4": &subscribe.DataItem{Value: newArticle.CountLove},
|
226
|
//温馨提示
|
231
|
//温馨提示
|
227
|
"thing5": &subscribe.DataItem{Value: "这条内容很受欢迎哦,快来看看吧"},
|
232
|
"thing5": &subscribe.DataItem{Value: "这条内容很受欢迎哦,快来看看吧"},
|
228
|
},
|
233
|
},
|
|
@@ -243,6 +248,11 @@ func (l *MiniSubscribeLogic) LikeComment(conn transaction.Conn, comment *domain. |
|
@@ -243,6 +248,11 @@ func (l *MiniSubscribeLogic) LikeComment(conn transaction.Conn, comment *domain. |
243
|
if err != nil || openId == "" {
|
248
|
if err != nil || openId == "" {
|
244
|
return nil
|
249
|
return nil
|
245
|
}
|
250
|
}
|
|
|
251
|
+ //获取被赞次数
|
|
|
252
|
+ newComment, err := l.svcCtx.ArticleCommentRepository.FindOne(l.ctx, conn, comment.Id)
|
|
|
253
|
+ if err != nil {
|
|
|
254
|
+ return xerr.NewErrMsgErr("未获取到评论信息", err)
|
|
|
255
|
+ }
|
246
|
msg := &subscribe.Message{
|
256
|
msg := &subscribe.Message{
|
247
|
ToUser: openId,
|
257
|
ToUser: openId,
|
248
|
TemplateID: domain.SubscribeTemplateLike,
|
258
|
TemplateID: domain.SubscribeTemplateLike,
|
|
@@ -255,7 +265,7 @@ func (l *MiniSubscribeLogic) LikeComment(conn transaction.Conn, comment *domain. |
|
@@ -255,7 +265,7 @@ func (l *MiniSubscribeLogic) LikeComment(conn transaction.Conn, comment *domain. |
255
|
//动态内容
|
265
|
//动态内容
|
256
|
"thing8": &subscribe.DataItem{Value: comment.GetSubscribeMessageContent()},
|
266
|
"thing8": &subscribe.DataItem{Value: comment.GetSubscribeMessageContent()},
|
257
|
//被赞次数
|
267
|
//被赞次数
|
258
|
- "number4": &subscribe.DataItem{Value: comment.CountUserLove},
|
268
|
+ "number4": &subscribe.DataItem{Value: newComment.CountUserLove},
|
259
|
//温馨提示
|
269
|
//温馨提示
|
260
|
"thing5": &subscribe.DataItem{Value: "这条内容很受欢迎哦,快来看看吧"},
|
270
|
"thing5": &subscribe.DataItem{Value: "这条内容很受欢迎哦,快来看看吧"},
|
261
|
},
|
271
|
},
|