aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-28 22:38:21 +0300
committerGravatar Vitaly Takmazov2017-01-10 12:08:35 +0300
commit2f682b5e3cfc3fc5f961b60129be7bc90e0d6a03 (patch)
tree840aea9eb94d5c1f667a710d3298135854bc5002 /juick-server/src/main/java/com/juick/service/UserServiceImpl.java
parenteb440ea4f120115613880e340b010eed5397e72c (diff)
juick-www: now on spring-webmvc
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/UserServiceImpl.java')
-rw-r--r--juick-server/src/main/java/com/juick/service/UserServiceImpl.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
index f226b402..05ef4c95 100644
--- a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
@@ -674,4 +674,23 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
.addValue("hash", loginHash)
.addValue("uid", uid));
}
+
+ @Transactional
+ @Override
+ public void logout(int uid) {
+ getJdbcTemplate().update("DELETE FROM logins WHERE user_id=?", uid);
+ }
+
+ @Transactional
+ @Override
+ public boolean deleteJID(int uid, String jid) {
+ return getJdbcTemplate().update("DELETE FROM jids WHERE user_id=? AND jid=?", uid, jid) > 0;
+ }
+
+ @Transactional
+ @Override
+ public boolean unauthJID(int uid, String jid) {
+ return getJdbcTemplate()
+ .update("DELETE FROM auth WHERE user_id=? AND protocol='xmpp' AND account=?", uid, jid) > 0;
+ }
}