aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com/juick/service/CrosspostServiceImpl.java
diff options
context:
space:
mode:
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.java10
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)