通知 API
推播通知與通知中心端點。
推播通知
POST /notifications/push
發送推播通知。
Request Body
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
| `user_id` | string | ✅ | 目標使用者 |
| `title` | string | ✅ | 通知標題 |
| `body` | string | ✅ | 通知內容 |
| `data` | object | ❌ | 附加數據 |
POST /notifications/tokens/device
註冊推播 token。
Request Body
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
| `token` | string | ✅ | FCM device token |
| `platform` | string | ✅ | 平台(`ios`, `android`) |
通知中心
GET /notifications/center
取得通知中心的通知列表。
Query Parameters
| 參數 | 類型 | 說明 |
|---|---|---|
| `page_size` | int | 每頁數量 |
| `before` | number | 分頁(epoch ms) |
GET /notifications/center/counts
取得未讀通知數量。
Response (200)
{"unread": 5, "total": 120}
PATCH /notifications/center/{notification_id}/read
標記通知為已讀。
POST /notifications/center/mark-all-read
標記所有通知為已讀。
DELETE /notifications/center/{notification_id}
刪除通知。