diff options
author | Vitaly Takmazov | 2017-12-27 16:23:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-01-12 09:12:09 +0300 |
commit | bf5f2142d73a5745124d03f6b6f06c59873e47de (patch) | |
tree | 969d43a3bf6d39197313e16080b8b8472975cbe2 /juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java | |
parent | 0c78bc5c08632718eb94c0021cf3ee47fb8ddb82 (diff) |
Messenger bot
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java index dec8db5b..fb9ef167 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java @@ -63,13 +63,13 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe @Transactional(readOnly = true) @Override - public Optional<String> getFacebookToken(final int uid) { - List<String> list = getJdbcTemplate().queryForList( - "SELECT access_token FROM facebook WHERE user_id = ? AND access_token IS NOT NULL AND crosspost = 1", - String.class, + 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", + (rs, num) -> Optional.of(Pair.of(rs.getString(1), rs.getString(2))), uid); return list.isEmpty() ? - Optional.empty() : Optional.of(list.get(0)); + Optional.empty() : list.get(0); } @Transactional(readOnly = true) |