/internal/communication/push/subscriptions
为显式指定的 user_id 注册 Web Push 订阅(每用户上限 10 条)
请求参数
| 名称 | 位置 | 类型 | 必填 | 默认值 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|---|---|
X-Tenant-ID |
header |
string |
是 | 租户ID |
请求体
Schema: service-communication/internal/handler/dto.InternalRegisterPushSubscriptionRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
endpoint |
string |
是 | https://fcm.googleapis.com/fcm/send/... |
||
keys |
service-communication/internal/handler/dto.PushSubscriptionKeys |
是 | |||
user_id |
string |
是 | user-001 |
||
app_id |
string |
否 | |||
device_name |
string |
否 | Chrome on Windows |
||
device_type |
string |
否 | web |
||
user_agent |
string |
否 |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 201 | 注册成功 | service-communication/internal/handler/dto.PushSubscriptionDetailResponse |
| 400 | 请求参数错误 | dto.SimpleResponse |
| 500 | 服务内部错误 | dto.SimpleResponse |
引用的 Schema
dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-communication/internal/handler/dto.PushSubscriptionDetailResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
data |
service-communication/internal/handler/dto.PushSubscriptionResponse |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-communication/internal/handler/dto.PushSubscriptionKeys
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
auth |
string |
是 | xK2s9... |
||
p256dh |
string |
是 | BP7S2s9... |
service-communication/internal/handler/dto.PushSubscriptionResponse
Web Push 订阅信息
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
created_at |
string |
否 | 2026-05-12T12:00:00Z |
||
device_name |
string |
否 | Chrome on Windows |
||
device_type |
string |
否 | web |
||
endpoint |
string |
否 | https://fcm.googleapis.com/fcm/send/... |
||
id |
string |
否 | sub-abc123 |