Files
one-pipe-system/openspec/changes/update-admin-notification-center-api/tasks.md
luo 9289a6e940
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m5s
feat: 完善接口19-顶部通知铃铛与站内通知中心
2026-07-25 10:20:53 +08:00

35 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. Contract And Types
- [x] 1.1 按实际接口更新通知项、列表响应、未读数、未读汇总和受控目标类型。
- [x] 1.2 将通知列表筛选参数从 `read_status` 改为 `is_read?: boolean`
- [x] 1.3 更新通知 service未读数、未读汇总、列表、单条已读、全部已读和目标接口的请求/响应类型。
## 2. Shared Notification State
- [x] 2.1 使用 `data.count``data.display_count` 同步未读数量及顶部徽标。
- [x] 2.2 使用 `{ approval, expiry, sync, system, total }` 保存分类汇总并通过通知列表接口加载抽屉最近10条。
- [x] 2.3 单条已读和全部已读成功后刷新真实未读数、汇总和相关通知状态,避免仅修改本地计数。
## 3. Header And Notification Center
- [x] 3.1 顶部铃铛展示后端 `display_count`支持0、普通数量和 `99+`
- [x] 3.2 抽屉展示最近10条真实通知支持全部、审批、临期、同步/系统分类和进入通知中心。
- [x] 3.3 通知中心使用 `body``is_read``read_at` 展示正文、状态和已读时间。
- [x] 3.4 通知中心筛选使用 `category``type``severity``is_read``page``page_size`
- [x] 3.5 严重级别支持 `info``warning``error``critical`,未知值稳定展示。
- [x] 3.6 全部已读和单条已读严格按实际 PUT 接口调用。
## 4. Controlled Navigation And Scope
- [x] 4.1 根据 `target_type``target_key``target_id`实现前端内部目标白名单映射。
- [x] 4.2 未知、无权限或不可用目标只展示通知正文,不执行任意 URL 或未注册路由跳转。
- [x] 4.3 保留管理端通知中心路由和顶部入口,不新增 C 端通知接口、页面或逻辑。
## 5. Verification
- [x] 5.1 验证真实通知字段 `body``is_read``read_at``ref_key` 正确展示和保存。
- [x] 5.2 验证未读徽标、分类汇总、抽屉列表和通知中心状态一致。
- [x] 5.3 验证 `is_read=true/false` 筛选及全部已读 `category` 请求体。
- [x] 5.4 验证受控目标白名单和未知目标安全降级。
- [x] 5.5 运行类型检查、lint、相关测试、构建和 `openspec validate update-admin-notification-center-api --strict`