From 9fd0533d314bb54ed3f1cdce97fc527f19d40651 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 20 Dec 2022 01:19:11 +0300 Subject: Fix social tokens queries --- src/main/java/com/juick/service/UserServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/juick/service') 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 getTwitterToken(final int uid) { List 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> getFacebookTokens(final int uid) { List>> 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) -- cgit v1.2.3