POST /communication/push-tokens

为当前租户下的指定用户注册设备推送令牌(iOS APNs / Android FCM / Web Push / Desktop),用于后续推送通知发送。相同Token重复注册会自动停用旧记录,确保每个Token在库中唯一且最新。参考:ePrivacy Directive 2002/58/EC、CAN-SPAM Act。

通信服务 `bearerAuth` application/json

请求体

Schema: service-communication/internal/handler/dto.CreatePushTokenRequest

字段类型必填示例约束描述
platform string 是 ios enum: `ios`, `android`, `web`, `desktop`
token string 是 device_token_xxx
user_id string 是 usr_abc123
device_id string 否 iPhone15-001

响应

状态描述Schema
201注册成功,返回令牌详情service-communication/internal/handler/dto.PushTokenDataResponse
400请求参数错误dto.SimpleResponse
401未认证或令牌无效dto.SimpleResponse
403无权访问该资源dto.SimpleResponse
500服务内部错误dto.SimpleResponse

引用的 Schema

dto.SimpleResponse

字段类型必填示例约束描述
code integer 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.PushTokenDataResponse

字段类型必填示例约束描述
code integer 否
data service-communication/internal/handler/dto.PushTokenResponse 否
message string 否
timestamp string 否

service-communication/internal/handler/dto.PushTokenResponse

推送令牌信息

字段类型必填示例约束描述
created_at string 否 2026-04-15T10:00:00Z
device_id string 否 iPhone15-001
id string 否 pt_abc123
is_active boolean 否 True
platform string 否 ios
user_id string 否 usr_abc123