feat(count): 实现评论发布后异步更新笔记评论数功能

- 新增 CountPublishCommentMqDTO 用于传输评论计数消息
- 在评论服务中添加异步发送评论计数消息逻辑
- 新建 CountNoteCommentConsumer 消费评论计数消息并批量更新笔记评论数
- 扩展 t_comment 表结构,新增 child_comment_total 字段
- 更新 MQ 常量配置,添加评论计数相关 Topic 定义
- 调整 LIKE/UNLIKE 和 COLLECT/UNCOLLECT 消费者中的注解使用(防止循环依赖)
- 修改 gateApi.http 中的测试用例内容以适配新功能
This commit is contained in:
2025-11-07 17:13:01 +08:00
parent f49d0e6b76
commit 63495b4938
12 changed files with 196 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ public class CollectUnCollectNoteConsumer {
private final RateLimiter rateLimiter = RateLimiter.create(5000);
@Value("${rocketmq.name-server}")
private String nameServer;
@Resource
private DefaultMQPushConsumer consumer;
@Resource
private NoteCollectionDOMapper noteCollectionDOMapper;

View File

@@ -35,7 +35,7 @@ public class LikeUnlikeNoteConsumer {
private final RateLimiter rateLimiter = RateLimiter.create(5000);
@Value("${rocketmq.name-server}")
private String nameServer;
@Resource
private DefaultMQPushConsumer consumer;
@Resource
private NoteLikeDOMapper noteLikeDOMapper;