feat(comment): 实现评论异步消费与内容存储

- 新增评论内容批量存储接口与实现
- 实现MQ消息消费端处理评论发布逻辑
- 支持一级与二级评论的层级关系构建
- 添加评论内容与元数据分离存储机制
- 集成分布式ID生成服务用于评论ID生成
- 完善评论相关DTO、DO、BO模型类
- 添加Cassandra数据库操作支持
- 实现Feign接口调用与事务控制
This commit is contained in:
2025-11-05 19:19:19 +08:00
parent c37b16ff42
commit a37e76c87c
22 changed files with 575 additions and 4 deletions

View File

@@ -25,4 +25,31 @@
id, note_id, user_id, content_uuid, is_content_empty, image_url, `level`, reply_total,
like_total, parent_id, reply_comment_id, reply_user_id, is_top, create_time, update_time
</sql>
<select id="selectByCommentIds" resultMap="BaseResultMap" parameterType="list">
select id,
level,
parent_id,
user_id
from t_comment
where id in
<foreach collection="commentIds" open="(" separator="," close=")" item="commentId">
#{commentId}
</foreach>
</select>
<insert id="batchInsert" parameterType="list">
insert IGNORE into t_comment (id, note_id, user_id,
content_uuid, is_content_empty, image_url,
`level`, reply_total, like_total,
parent_id, reply_comment_id, reply_user_id,
is_top, create_time, update_time)
values
<foreach collection="comments" item="comment" separator=",">
( #{comment.id}, #{comment.noteId}, #{comment.userId}, #{comment.contentUuid}, #{comment.isContentEmpty}
, #{comment.imageUrl}, #{comment.level}, #{comment.replyTotal}, #{comment.likeTotal}, #{comment.parentId}
, #{comment.replyCommentId}, #{comment.replyUserId}, #{comment.isTop}, #{comment.createTime}
, #{comment.updateTime})
</foreach>
</insert>
</mapper>