aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r--juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java b/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java
index aca48a19..73f98abf 100644
--- a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java
@@ -15,7 +15,6 @@ import java.util.List;
* Created by aalexeev on 11/13/16.
*/
@Repository
-@Transactional(readOnly = true)
public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueriesService {
@Inject
@@ -23,6 +22,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
super(jdbcTemplate, null);
}
+ @Transactional(readOnly = true)
@Override
public List<String> getGCMRegID(final int uid) {
return getJdbcTemplate().queryForList(
@@ -31,6 +31,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
uid);
}
+ @Transactional(readOnly = true)
@Override
public List<String> getGCMTokens(final Collection<Integer> uids) {
if (CollectionUtils.isEmpty(uids))
@@ -42,17 +43,20 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
String.class);
}
+ @Transactional
@Override
public boolean addGCMToken(Integer uid, String token) {
return getJdbcTemplate().update("INSERT IGNORE INTO android(user_id,regid) VALUES (?, ?)",
uid, token) > 0;
}
+ @Transactional
@Override
public boolean deleteGCMToken(String token) {
return getJdbcTemplate().update("DELETE FROM android WHERE regid=?", token) > 0;
}
+ @Transactional(readOnly = true)
@Override
public List<String> getMPNSURL(final int uid) {
return getJdbcTemplate().queryForList(
@@ -61,6 +65,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
uid);
}
+ @Transactional(readOnly = true)
@Override
public List<String> getMPNSTokens(final Collection<Integer> uids) {
if (CollectionUtils.isEmpty(uids))
@@ -72,17 +77,20 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
String.class);
}
+ @Transactional
@Override
public boolean addMPNSToken(Integer uid, String token) {
return getJdbcTemplate().update("INSERT IGNORE INTO winphone(user_id,url) VALUES (?, ?)",
uid, token) > 0;
}
+ @Transactional
@Override
public boolean deleteMPNSToken(String token) {
return getJdbcTemplate().update("DELETE FROM winphone WHERE url=?", token) > 0;
}
+ @Transactional(readOnly = true)
@Override
public List<String> getAPNSToken(final int uid) {
return getJdbcTemplate().queryForList(
@@ -91,11 +99,13 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
uid);
}
+ @Transactional
@Override
public boolean deleteAPNSToken(String token) {
return getJdbcTemplate().update("DELETE FROM ios WHERE token=?", token) > 0;
}
+ @Transactional(readOnly = true)
@Override
public List<String> getAPNSTokens(final Collection<Integer> uids) {
if (CollectionUtils.isEmpty(uids))
@@ -107,6 +117,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri
String.class);
}
+ @Transactional
@Override
public boolean addAPNSToken(Integer uid, String token) {
return getJdbcTemplate().update("INSERT IGNORE INTO ios(user_id,token) VALUES (?, ?)",