diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java b/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java index e1c59e657..14bdc7e2c 100644 --- a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java @@ -60,6 +60,11 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe } @Override + public void addVKState(String state, String redirectUri) { + jdbcTemplate.update("INSERT INTO vk(loginhash, vk_link) VALUES(?, ?)", state, redirectUri); + } + + @Override public String verifyFacebookState(String state) { try { return jdbcTemplate.queryForObject("SELECT fb_link FROM facebook WHERE loginhash=?", @@ -69,6 +74,16 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe } } + @Override + public String verifyVKState(String state) { + try { + return jdbcTemplate.queryForObject("SELECT vk_link FROM vk WHERE loginhash=?", + String.class, state); + } catch (EmptyResultDataAccessException e) { + return StringUtils.EMPTY; + } + } + @Transactional(readOnly = true) @Override public Optional<Pair<String, String>> getFacebookTokens(final int uid) { |