feat(admin): add admin endpoint to list user devices with JPush registration IDs
- Add AdminDeviceTokenResponse DTO including push_token (RegistrationID) for push debugging - Add DeviceTokenToAdminResponse and DeviceTokensToAdminResponse converters - Inject PushService into AdminUserHandler for retrieving user devices - Register GET /api/v1/admin/users/:id/devices route for querying target user's device tokens
This commit is contained in:
@@ -499,6 +499,22 @@ type DeviceTokenResponse struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// AdminDeviceTokenResponse 管理端设备Token响应
|
||||
// 相比 DeviceTokenResponse,额外包含 user_id 与 push_token(即 JPush RegistrationID),
|
||||
// 供后台查询用户设备 registration_id 使用。
|
||||
type AdminDeviceTokenResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID string `json:"user_id"`
|
||||
DeviceID string `json:"device_id"`
|
||||
DeviceType string `json:"device_type"`
|
||||
PushToken string `json:"push_token,omitempty"` // JPush RegistrationID
|
||||
IsActive bool `json:"is_active"`
|
||||
DeviceName string `json:"device_name,omitempty"`
|
||||
LastUsedAt time.Time `json:"last_used_at,omitzero"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// ==================== 推送记录 DTOs ====================
|
||||
|
||||
// PushRecordResponse 推送记录响应
|
||||
|
||||
Reference in New Issue
Block a user