Files
NextEdu/src/shared/i18n/messages/zh-CN/announcements.json
SpecialX f75602d14e feat(announcements,messaging,notifications): 实现所有长期问题 — SSE 实时推送 + 通知日志持久化 + 优先级/归档 + 消息星标/草稿 + 公告已读回执/置顶 + 分类筛选/桌面推送 + 测试覆盖
P1-8 通知实时推送(SSE):
- 新增 /api/notifications/stream SSE 端点(15 秒推送,5 分钟超时)
- 新增 useNotificationStream Hook(SSE + 轮询降级)
- NotificationDropdown 改用 SSE 实时推送

P2-12 测试覆盖:
- notifications/dispatcher.test.ts(6 个测试,渠道选择逻辑)
- notifications/channels/in-app-channel.test.ts(9 个测试,类型映射)
- messaging/schema.test.ts(34 个测试,Zod 校验)
- tests/e2e/messages.spec.ts(消息模块 E2E 测试)
- vitest.unit.config.ts 添加 server-only stub

P2-13a 通知发送日志持久化:
- 新增 notification_logs 表(userId/title/channel/status/messageId/error/sentAt)
- logNotificationSend 改为 async 写入 DB(失败降级 console)
- dispatcher 传递 payload 用于持久化

P2-13b 通知优先级和归档:
- messageNotifications 表新增 priority(low/normal/high/urgent)和 isArchived 字段
- getNotifications 支持归档和优先级筛选
- 新增 archiveNotificationAction
- NotificationList 显示优先级 Badge 和归档按钮

P2-13c 消息星标和草稿:
- messages 表新增 isStarred 字段
- 新增 message_drafts 表
- 新增 toggleMessageStar + 草稿 CRUD Server Actions
- 新增 5 个草稿 data-access 函数

P2-13d 公告已读回执和置顶:
- announcements 表新增 isPinned 字段
- 新增 announcement_reads 表(唯一索引保证幂等)
- 新增 toggleAnnouncementPinAction + markAnnouncementAsReadAction
- getAnnouncements 排序置顶优先

P2-13e 通知分类筛选和桌面推送:
- NotificationList 添加按类型筛选按钮组
- 新增 useDesktopNotifications Hook(浏览器 Notification API)
- NotificationDropdown 集成桌面推送(新通知触发)

架构图同步:
- 004 和 005 均已更新(新增表、Action、Hook、组件描述)
2026-06-23 10:13:57 +08:00

103 lines
2.8 KiB
JSON

{
"title": {
"list": "公告",
"detail": "公告详情",
"adminList": "公告管理",
"edit": "编辑公告",
"create": "新建公告"
},
"description": {
"list": "随时了解学校最新公告动态。",
"adminList": "创建并管理全校公告。",
"edit": "更新公告详情。"
},
"filter": {
"all": "全部",
"published": "已发布",
"draft": "草稿",
"archived": "已归档",
"placeholder": "按状态筛选"
},
"status": {
"draft": "草稿",
"published": "已发布",
"archived": "已归档",
"pinned": "已置顶",
"read": "已读",
"unread": "未读"
},
"type": {
"school": "全校",
"grade": "年级",
"class": "班级"
},
"form": {
"title": "标题",
"titlePlaceholder": "公告标题",
"content": "内容",
"contentPlaceholder": "请输入公告内容...",
"type": "类型",
"typePlaceholder": "选择类型",
"status": "状态",
"statusPlaceholder": "选择状态",
"targetGrade": "目标年级",
"targetGradePlaceholder": "选择年级(可选)",
"targetClass": "目标班级",
"targetClassPlaceholder": "选择班级(可选)",
"submit": "保存",
"create": "创建",
"cancel": "取消",
"saving": "保存中..."
},
"actions": {
"new": "新建公告",
"publish": "发布",
"archive": "归档",
"edit": "编辑",
"delete": "删除",
"back": "返回",
"pin": "置顶",
"unpin": "取消置顶",
"markRead": "标记已读"
},
"messages": {
"created": "公告已创建",
"updated": "公告已更新",
"deleted": "公告已删除",
"published": "公告已发布",
"archived": "公告已归档",
"notFound": "公告不存在",
"createFailed": "创建公告失败",
"updateFailed": "保存公告失败",
"publishFailed": "发布失败",
"archiveFailed": "归档失败",
"deleteFailed": "删除失败",
"invalidForm": "表单数据无效",
"invalidState": "表单状态无效",
"pinToggled": "置顶状态已更新",
"markedRead": "已标记为已读"
},
"meta": {
"publishedAt": "发布于 {date}",
"createdAt": "创建于 {date}",
"updatedAt": "更新于 {date}",
"author": "作者:{name}"
},
"empty": {
"noAnnouncements": "暂无公告",
"noAnnouncementsDesc": "目前还没有任何公告。",
"noMatch": "当前筛选条件下暂无公告。",
"deleteTitle": "删除公告",
"deleteDesc": "此操作将永久删除公告{title}。"
},
"notification": {
"publishedTitle": "新公告:{title}",
"publishedContent": "您有一条新公告,请及时查看。"
},
"error": {
"loadFailed": "公告加载失败",
"loadFailedDesc": "抱歉,加载公告时发生了意外错误。请稍后重试。",
"retry": "重试"
}
}