通知 API

通知中心 REST API 文档

通知 API

获取通知列表

GET /api/notifications?status=all&source=&page=1&limit=20

参数

参数 类型 说明
status string all / pending / sent / read
source string schedule / ai_message / system
page number 页码
limit number 每页数量

响应

{
  "total": 42,
  "page": 1,
  "limit": 20,
  "notifications": [
    {
      "id": 1,
      "source": "schedule",
      "title": "Mac Mini 01 完成了日报生成",
      "summary": "...",
      "status": "sent",
      "im_channel": "wecom",
      "created_at": "2026-03-15T10:00:00",
      "read_at": ""
    }
  ]
}

批量标记已读

POST /api/notifications/batch-read
Body: { "notification_ids": [1, 2, 3] }
// 或全部标记:
Body: { "all": true }