feat(user-relation): 实现用户关注与取消关注功能

- 在 t_following 和 t_fans 表中添加联合唯一索引,确保关注关系的幂等性- 新增 RocketMQ 消费者 FollowUnfollowConsumer,处理关注和取消关注消息
- 实现关注逻辑,通过事务保证关注表和粉丝表数据一致性
- 修改 DeleteNoteLocalCacheConsumer 的 consumerGroup 名称,避免消费者组冲突,否则可能遇到消费者不消费的情况
This commit is contained in:
2025-10-12 21:17:39 +08:00
parent 5a7564d504
commit 362c32cbd6
4 changed files with 111 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ POST http://localhost:8000/auth/verification/code/send
Content-Type: application/json
{
"email": "ssw010723@gmail.com"
"email": "2628273921@qq.com"
}
### 登录/注册
@@ -11,8 +11,8 @@ POST http://localhost:8000/auth/login
Content-Type: application/json
{
"email": "ssw010723@gmail.com",
"code": "135466",
"email": "2628273921@qq.com",
"code": "825004",
"type": 1
}
@@ -144,5 +144,5 @@ Content-Type: application/json
Authorization: Bearer {{token}}
{
"followUserId":{{otherUserId}}
"followUserId": {{otherUserId}}
}