From aa3c1a06ed46f49b617e2956b6cf9a1b0d367fb0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 22 Nov 2016 17:49:03 +0300 Subject: add APNS feedback component --- .../main/java/com/juick/server/PushQueries.java | 4 +++ .../java/com/juick/server/helpers/TokensList.java | 30 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 juick-server/src/main/java/com/juick/server/helpers/TokensList.java (limited to 'juick-server/src/main/java/com/juick/server') diff --git a/juick-server/src/main/java/com/juick/server/PushQueries.java b/juick-server/src/main/java/com/juick/server/PushQueries.java index 904b3c0d..5ee3cef3 100644 --- a/juick-server/src/main/java/com/juick/server/PushQueries.java +++ b/juick-server/src/main/java/com/juick/server/PushQueries.java @@ -41,4 +41,8 @@ public class PushQueries { return sql.queryForList("SELECT token FROM ios INNER JOIN users " + "ON (users.id=ios.user_id) WHERE users.id IN (" + StringUtils.collectionToCommaDelimitedString(uids) + ")", String.class); } + + public static boolean deleteAPNSToken(JdbcTemplate sql, String token) { + return sql.update("DELETE FROM ios WHERE token=?", token) > 0; + } } diff --git a/juick-server/src/main/java/com/juick/server/helpers/TokensList.java b/juick-server/src/main/java/com/juick/server/helpers/TokensList.java new file mode 100644 index 00000000..cb331e04 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/helpers/TokensList.java @@ -0,0 +1,30 @@ +package com.juick.server.helpers; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * Created by vitalyster on 22.11.2016. + */ +public class TokensList { + private String type; + private List tokens; + + @JsonProperty("type") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getTokens() { + return tokens; + } + + public void setTokens(List tokens) { + this.tokens = tokens; + } +} -- cgit v1.2.3