From cf437e3004149efe3b65e80d618374eb28cca641 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 21 Dec 2022 03:26:49 +0300 Subject: external tokens: adopt records --- src/main/java/com/juick/www/api/Notifications.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main/java/com/juick/www') diff --git a/src/main/java/com/juick/www/api/Notifications.java b/src/main/java/com/juick/www/api/Notifications.java index 43465c1a..5f941ba5 100644 --- a/src/main/java/com/juick/www/api/Notifications.java +++ b/src/main/java/com/juick/www/api/Notifications.java @@ -133,15 +133,15 @@ public class Notifications { throw new HttpForbiddenException(); } list.forEach(t -> { - switch (t.getType()) { + switch (t.type()) { case "gcm": - pushQueriesService.deleteGCMToken(t.getToken()); + pushQueriesService.deleteGCMToken(t.token()); break; case "apns": - pushQueriesService.deleteAPNSToken(t.getToken()); + pushQueriesService.deleteAPNSToken(t.token()); break; case "mpns": - pushQueriesService.deleteMPNSToken(t.getToken()); + pushQueriesService.deleteMPNSToken(t.token()); break; default: throw new HttpBadRequestException(); @@ -159,15 +159,15 @@ public class Notifications { throw new HttpForbiddenException(); } list.forEach(t -> { - switch (t.getType()) { + switch (t.type()) { case "gcm": - pushQueriesService.deleteGCMToken(t.getToken()); + pushQueriesService.deleteGCMToken(t.token()); break; case "apns": - pushQueriesService.deleteAPNSToken(t.getToken()); + pushQueriesService.deleteAPNSToken(t.token()); break; case "mpns": - pushQueriesService.deleteMPNSToken(t.getToken()); + pushQueriesService.deleteMPNSToken(t.token()); break; default: throw new HttpBadRequestException(); @@ -183,15 +183,15 @@ public class Notifications { @Visitor User visitor, @RequestBody List list) { list.forEach(t -> { - switch (t.getType()) { + switch (t.type()) { case "gcm": - pushQueriesService.addGCMToken(visitor.getUid(), t.getToken()); + pushQueriesService.addGCMToken(visitor.getUid(), t.token()); break; case "apns": - pushQueriesService.addAPNSToken(visitor.getUid(), t.getToken()); + pushQueriesService.addAPNSToken(visitor.getUid(), t.token()); break; case "mpns": - pushQueriesService.addMPNSToken(visitor.getUid(), t.getToken()); + pushQueriesService.addMPNSToken(visitor.getUid(), t.token()); break; default: throw new HttpBadRequestException(); -- cgit v1.2.3