aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java/com/juick/components/service
diff options
context:
space:
mode:
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/service')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java b/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
index 4dd949c3..7b9a88a3 100644
--- a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
+++ b/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java
@@ -1,6 +1,6 @@
package com.juick.components.service;
-import com.juick.TokensList;
+import com.juick.DeviceRegistration;
import com.juick.service.BaseRestService;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
@@ -12,6 +12,7 @@ import org.springframework.web.client.RestTemplate;
import javax.inject.Inject;
import java.util.List;
+import java.util.stream.Collectors;
/**
* Created by vitalyster on 15.12.2016.
@@ -27,9 +28,8 @@ public class NotificationsTokenService extends BaseRestService implements TokenS
@Override
public void deleteTokens(String type, List<String> devices) {
if (devices.size() > 0) {
- TokensList list = new TokensList();
- list.setType(type);
- list.setTokens(devices);
+ List<DeviceRegistration> list = devices.stream()
+ .map(d -> new DeviceRegistration(type, d)).collect(Collectors.toList());
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
getRest().exchange("http://api.juick.com/notifications",