跳转到主要内容
notifications 保存显示在用户项目面板顶部的通知。一个文档是给一个用户的一条通知,由其 key 标识。只有 notifications 服务直接访问该集合(services/notifications/app/js/Notifications.js);web 和 third-party-datastore 调用它的 HTTP API。没有 Mongoose schema。

字段

谁写入

CE 和我们的模块创建的通知: NotificationsBuilder.mjs 还为群组邀请、机构关联、订阅和旧调试项目构建 key。它们的调用方位于订阅和机构相关代码中,而旧调试项目检查只在 isSaas 时运行(services/web/app/src/Features/Project/ProjectListController.mjs:234-236)。

谁读取

索引

说明

  • 已读通知不会被删除:只会去掉 templateKey。由于文档仍保留 key,之后对同一 key 不带 forceCreate 的 addNotification 不会产生任何效果(Notifications.js:21-24)。
  • /key/:key 路由只按 key 操作,跨越所有用户(Notifications.js:76-100)。
  • 如果 web 没有 apis.notifications.url,它既不创建也不读取通知(NotificationsHandler.mjs:17、:41)。
最后修改于 2026年11月20日