diff options
author | Vitaly Takmazov | 2022-12-20 01:19:11 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-20 01:58:27 +0300 |
commit | 9fd0533d314bb54ed3f1cdce97fc527f19d40651 (patch) | |
tree | 9811553763933e74966c37389b0a36cfc2e5e10f /src | |
parent | 8595c80aad53adfe414bad57fa7aab6a5d8d25c1 (diff) |
Fix social tokens queries
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/service/UserServiceImpl.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java index b2941d59..4b07d882 100644 --- a/src/main/java/com/juick/service/UserServiceImpl.java +++ b/src/main/java/com/juick/service/UserServiceImpl.java @@ -687,7 +687,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Override public Optional<ExternalToken> getTwitterToken(final int uid) { List<ExternalToken> list = getJdbcTemplate().query( - "SELECT uname, access_token, access_token_secret FROM twitter WHERE user_id = ? AND crosspost = 1", + "SELECT uname, access_token, access_token_secret FROM twitter WHERE user_id = ? AND crosspost = true", (rs, num) -> new ExternalToken(rs.getString(1), "twitter", rs.getString(2), rs.getString(3)), uid); @@ -736,7 +736,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Override public Optional<Pair<String, String>> getFacebookTokens(final int uid) { List<Optional<Pair<String, String>>> list = getJdbcTemplate().query( - "SELECT fb_id, access_token FROM facebook WHERE user_id = ? AND access_token IS NOT NULL AND crosspost = 1", + "SELECT fb_id, access_token FROM facebook WHERE user_id = ? AND access_token IS NOT NULL AND crosspost = true", (rs, num) -> Optional.of(Pair.of(rs.getString(1), rs.getString(2))), uid); return list.isEmpty() ? @@ -765,13 +765,13 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { @Transactional @Override public boolean enableFBCrosspost(Integer uid) { - return getJdbcTemplate().update("UPDATE facebook SET crosspost=1 WHERE user_id=?", uid) > 0; + return getJdbcTemplate().update("UPDATE facebook SET crosspost=true WHERE user_id=?", uid) > 0; } @Transactional @Override public void disableFBCrosspost(Integer uid) { - getJdbcTemplate().update("UPDATE facebook SET crosspost=0 WHERE user_id=?", uid); + getJdbcTemplate().update("UPDATE facebook SET crosspost=false WHERE user_id=?", uid); } @Transactional(readOnly = true) |