liuyun ff7d9bffa3
Some checks are pending
CI / backend (push) Waiting to run
CI / frontend (push) Waiting to run
feat(notice): 站内通知(子模块 + openspec change)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 22:25:30 +08:00

28 lines
1.3 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.

## Why
缺少站内通知/公告:管理员发布的通知用户无处查看,也没有未读提示。需要一个最小闭环的站内通知能力——管理员发公告,用户顶栏铃铛看未读、读后标记。投递用轮询(简单、fork 友好),范围仅站内(不接邮件/短信)。
## What Changes
- 新增 `notice`(通知/公告)与 `notice_read`(已读追踪)实体。
- 后端 `notices` 模块:管理侧 CRUD(`notice:*` 权限)+ 用户侧 `mine`/`unread-count`/`read`/`read-all`(仅登录态)。
- 前端:通知管理页 + 顶栏铃铛(未读角标 + 列表 + 标记已读),未读数轮询刷新。
## Capabilities
### New Capabilities
- `backend/notice`: 站内通知域——公告管理 + 用户已读/未读。
- `frontend/AD/notice`: 通知管理页 + 顶栏通知铃铛 + 轮询。
### Modified Capabilities
- `shared/data-model`: 新增 `notice`、`notice_read` 实体。
- `shared/api-contract`: 新增通知接口目录(管理 CRUD + 用户 mine/unread-count/read/read-all)。
## Impact
- **后端**:新增 `notices` 模块;Prisma(`sys_notice`、`sys_notice_read`);`tenant-template`(notice 菜单 + 接口资源)。
- **前端**:`api/notice.ts`、通知管理页、`ty-header` 铃铛 + 未读 store + 轮询定时器。
- **数据**:Prisma migration(两张新表)。