Update from task 6c938e10-135d-48a0-9c08-d84418f19ad3#17
Open
funoi-dev wants to merge 1 commit into
Open
Conversation
- **新增数据库模型**:`UserFollow` 表,用于存储用户之间的关注关系,包含 `follower_id`、`followed_id` 及 `created_at`。 - **新增后端API**: - `GET /api/follow/following`:获取当前用户关注的用户列表。 - `POST /api/follow/toggle`:切换关注/取消关注状态,支持幂等操作。 - **更新WebSocket事件**: - `user_join`:广播用户进入任意聊天室事件,供关注者监听。 - `user_leave`:广播用户离开任意聊天室事件,供关注者监听。 - **前端关键修改**: - `chat.js`:添加 `followedUserIds` 集合,加载关注列表并动态更新按钮状态。 - 增加 `toggleFollowUser` 函数,通过 API 切换关注状态。 - 在在线用户列表中添加可点击的关注按钮(+ / ✓),并响应关注状态变化。 - **优化用户体验**:当被关注用户进入或离开聊天室时,前端自动弹出通知提示。 整体实现关注功能的完整闭环,数据持久化存储,实时推送与前端交互无缝衔接。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was created by qwen-chat coder for task 6c938e10-135d-48a0-9c08-d84418f19ad3.