aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java/com/juick/components/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-06-29 17:09:49 +0300
committerGravatar Vitaly Takmazov2017-06-29 17:13:29 +0300
commitb75b5a3d1a3bf001923d49923dcebee95ba2327e (patch)
tree5080eacdf348c9598885ad5d3b5c567632db3717 /juick-notifications/src/main/java/com/juick/components/service
parent02723131139806c761539a42a5fa80b68ecadee8 (diff)
notifications and configurations refactoring
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",