bujinyuan
|
f1853f125d
|
feat: Phase 2e-1 统一通知中心 + 我的 TabBar 聚合未读红点
后端(notify 模块)
- 新增 notify 模块:DAO/Service/Pusher 接口/Controller/Router/CleanupTask
- 数据库 DDL:notify_notifications 表 + 3 索引(user+created/user+is_read/user+category)
- 11 种 type 枚举(好友/群聊 9 种 + meeting_* 2 种预留)+ 4 种 category
- 跨模块集成:contact 3 处 Pusher(friend_request/accepted/rejected)
- 跨模块集成:group 6 处 Pusher(invite/join_request/approved/rejected/kicked/role_changed)
- WS handler 断线补偿:连接建立即推送 notify.unread.total
- 5 REST API(4 用户 + 1 管理员广播)+ 2 WS 事件(notify.new / notify.unread.total)
- 30 天已读通知定时清理(未读永久保留)
- Provider/Wire 依赖注入(NotifyPusher、NotifyConnectHook、UserInfoResolver 接口)
前端
- 新增 notify 模块:API/Pinia Store(5 分类分页缓存 + 未读数 + WS 事件)/NotifyItem/通知中心主页
- profile 入口:铃铛 badge + 菜单项 badge + 数字显示
- App.vue/login 初始化 notifyStore WS 监听;logout 调用 notifyStore.reset() 清缓存
- 清理 contact.js/group.js 中散落 toast 与冗余 notify.friend.request/group.join.request 处理
- CustomTabBar 新增 hasDot() 聚合指示器:我的 Tab 显示纯红点(无数字),
当前聚合 notifyStore.unreadTotal,未来可扩展「资料待完善/安全提醒/新版本」等
文档
- 新增 Phase 2e 整体路线图 docs/plans/2026-04-20-phase2e-design.md
- 新增 Phase 2e-1 专用设计 docs/plans/2026-04-20-phase2e-1-design.md(§6.4 TabBar 聚合红点)
- 新增 Phase 2e-1 实施计划 docs/plans/2026-04-20-phase2e-1-implementation.plan.md
- 新增 E2E 验证报告 test-report-phase2e-1-notification.md(含 Playwright MCP 2 个现场 Bug 修复记录)
- 更新 docs/progress/CURRENT_STATUS.md、docs/api/README.md、docs/api/frontend/notify.md
- 更新 .cursor/rules/project-context.mdc、docs/plans/2026-02-27-echochat-system-design.md
其他
- .gitignore 排除 .playwright-mcp/ MCP 临时快照
架构决策
- 单端 WS 连接:沿用现有 ws.Hub,多端已读同步推迟到 Phase 2f/二期
- 跨模块依赖:contact/group → notify 严格单向(接口注入模式)
- 降级策略:Pusher 先入库后推送;WS 失败不回滚入库;入库失败仅 Warn 不影响业务
Playwright MCP 回归(4 类场景全通)
- 实时推送(admin 广播 → 1s 内前端自动插入 + 角标 +1)
- Deep-link 跳转(好友申请通知 → contact/request 页)
- 批量清零(全部已读按钮)
- TabBar 聚合红点(有未读亮/全部已读灭)与 notifyStore.unreadTotal 三层同步
Made-with: Cursor
|
2026-04-21 10:21:01 +08:00 |
|
bujinyuan
|
9399f86a19
|
feat:单聊页面bug修复+后台管理端好友页面bug修复+项目进度、记忆文件更新
|
2026-03-04 10:03:16 +08:00 |
|
bujinyuan
|
c8ae70ef97
|
fix(phase2a): handleError 增强 + 代码格式化 + 测试报告归档
- auth/contact Controller handleError 增加 fallbackMsg 可变参数,未知错误可返回更有语义的降级提示
- import 排序、变量对齐等 gofmt 格式规范化
- 新增管理端测试报告和路由验证报告
Made-with: Cursor
|
2026-03-03 09:51:43 +08:00 |
|
bujinyuan
|
2c59500e27
|
fix(phase2a): 代码审查修复 - 8项关键/重要问题
安全修复:
- WebSocket Token 增加 Redis 有效性校验(已登出用户无法建立 WS)
功能修复:
- GetRecommendFriends 改为批量查询,正确返回用户名/昵称/头像
- 上下线通知:OnlineService 通过接口注入获取好友列表推送状态变更
- 管理端在线用户 API 补充用户名信息
代码质量:
- 所有 json.Marshal/Redis 错误增加检查与日志
- ContactController 13 个 endpoint 统一走 handleError 业务错误映射
- 管理端 Controller 补全包注释、函数注释和结构化日志
- 前端 5 个联系人页面 avatar 工具函数抽取到 utils/avatar.js
Made-with: Cursor
|
2026-03-02 18:48:28 +08:00 |
|
bujinyuan
|
632e3b9a28
|
feat(contact): Controller、Router 与 Wire 集成
- controller/contact_controller.go: 全部 17 个 REST API 端点处理器
- router.go: Contact 模块路由注册(JWT 中间件保护)
- provider.go: Wire Provider Set(DAO + Service + Controller)
- 更新全局 provider、wire.go、router.go 集成 Contact 模块
Made-with: Cursor
|
2026-03-02 17:07:41 +08:00 |
|
bujinyuan
|
978037f085
|
feat(contact): Contact Service 业务逻辑
- 好友申请:发送/接受/拒绝 + 前置校验(自加/已好友/重复申请/黑名单)
- 好友管理:删除好友/更新备注
- 黑名单:拉黑(同时解除好友)/取消拉黑/黑名单列表
- 搜索:用户搜索(含好友标识)/好友推荐(基于共同好友)
- 分组:CRUD + 移动好友到分组
- 实时通知:好友申请/接受通过 Redis Pub/Sub 推送
Made-with: Cursor
|
2026-03-02 17:04:30 +08:00 |
|
bujinyuan
|
d4ab5af34e
|
feat(contact): Contact 模型、DAO、常量与 DTO
- model/friendship.go: 好友关系模型(双向存储,4 种状态)
- model/friend_group.go: 好友分组模型
- constants/contact.go: 好友关系状态常量
- dto/contact_dto.go: 联系人请求/响应 DTO
- dao/friendship_dao.go: 好友关系 CRUD + 搜索 + 共同好友
- dao/friend_group_dao.go: 好友分组 CRUD + 移动好友
Made-with: Cursor
|
2026-03-02 17:03:13 +08:00 |
|