POST /communication/push
向指定用户的所有激活设备发送推送通知。支持按平台(iOS/Android/Web/Desktop)筛选目标设备,自动记录每个Token的发送成功/失败情况。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。
通信服务 `bearerAuth` application/json
请求体
Schema: service-communication/internal/handler/dto.PushRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
body |
string |
是 |
您有一条新消息 |
|
内容 |
title |
string |
是 |
新消息通知 |
|
标题 |
user_id |
string |
是 |
usr_abc123 |
|
用户ID |
channel |
string |
否 |
ios |
|
渠道 |
data |
object |
否 |
|
|
数据 |
device_token |
string |
否 |
device_token_xxx |
|
设备Token |
platform |
string |
否 |
all |
enum: `all`, `ios`, `android`, `web`, `desktop` |
平台 |
引用的 Schema
dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
code |
integer |
否 |
|
|
|
message |
string |
否 |
|
|
|
timestamp |
string |
否 |
|
|
|
service-communication/internal/handler/dto.PushResultDetailResponse
service-communication/internal/handler/dto.PushResultResponse
推送发送结果
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
sent |
boolean |
否 |
True |
|
|
tokens_failed |
integer |
否 |
0 |
|
|
tokens_sent |
integer |
否 |
2 |
|
|