diff options
author | Vitaly Takmazov | 2016-12-01 15:06:08 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-01 15:06:08 +0300 |
commit | a19d224e5de6a067cc559a23cf6b4afdef060d56 (patch) | |
tree | 8198e97a3bd7354da2973ad647d99a110cfa69b5 /juick-server/src/main/java/com/juick/server | |
parent | 3d7f60c1c0b48dad2f58bffe3352d1c5c1b93f00 (diff) |
juick-api: Notifications controller from perl, refactoring
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/PushQueries.java | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/juick-server/src/main/java/com/juick/server/PushQueries.java b/juick-server/src/main/java/com/juick/server/PushQueries.java deleted file mode 100644 index 5ee3cef3..00000000 --- a/juick-server/src/main/java/com/juick/server/PushQueries.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.juick.server; - -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.util.StringUtils; - -import java.util.List; - -/** - * - * @author ugnich - */ -public class PushQueries { - - public static List<String> getAndroidRegID(JdbcTemplate sql, int uid) { - return sql.queryForList("SELECT regid FROM android WHERE user_id=?", String.class, uid); - } - - public static List<String> getAndroidTokens(JdbcTemplate sql, List<Integer> uids) { - return sql.queryForList("SELECT regid FROM android INNER JOIN users " + - "ON (users.id=android.user_id) WHERE users.id IN (" + StringUtils.collectionToCommaDelimitedString(uids) + ")", String.class); - } - - public static List<String> getWinPhoneURL(JdbcTemplate sql, int uid) { - return sql.queryForList("SELECT url FROM winphone WHERE user_id=?", String.class, uid); - } - - public static List<String> getWindowsTokens(JdbcTemplate sql, List<Integer> uids) { - return sql.queryForList("SELECT url FROM winphone INNER JOIN users " + - "ON (users.id=winphone.user_id) WHERE users.id IN (" + StringUtils.collectionToCommaDelimitedString(uids) + ")", String.class); - } - - public static List<String> getAPNSToken(JdbcTemplate sql, int uid) { - return sql.queryForList("SELECT token from ios WHERE user_id=?", String.class, uid); - } - - public static List<String> getAPNSTokens(JdbcTemplate sql, List<Integer> uids) { - 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; - } -} |