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:
@@ -627,13 +627,9 @@ func (s *chatServiceImpl) inlinePush(ctx context.Context, conv *model.Conversati
|
||||
}
|
||||
allTargetIDs = append(allTargetIDs, p.UserID)
|
||||
}
|
||||
var offlineTargetIDs []string
|
||||
if s.wsHub != nil && len(allTargetIDs) > 0 {
|
||||
_, offlineTargetIDs = s.wsHub.FilterOnline(allTargetIDs)
|
||||
} else {
|
||||
offlineTargetIDs = allTargetIDs
|
||||
}
|
||||
if len(offlineTargetIDs) > 0 {
|
||||
// 直接对所有参与者推送(不按 WS 在线过滤):
|
||||
// 多设备场景下某端在线不代表所有端在线,由 PushChatMessage 推送到用户所有移动设备
|
||||
if len(allTargetIDs) > 0 {
|
||||
go func(ids []string, sender ChatMessageSender, gid string, gavatar string) {
|
||||
for _, uid := range ids {
|
||||
if pushErr := s.pushSvc.PushChatMessage(context.Background(), uid, conversationID, &sender, convType, convName, message, gid, gavatar); pushErr != nil {
|
||||
@@ -644,7 +640,7 @@ func (s *chatServiceImpl) inlinePush(ctx context.Context, conv *model.Conversati
|
||||
)
|
||||
}
|
||||
}
|
||||
}(offlineTargetIDs, sender, groupID, groupAvatar)
|
||||
}(allTargetIDs, sender, groupID, groupAvatar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user