aboutsummaryrefslogtreecommitdiff
path: root/juick-crosspost/src/main/java/com/juick/service/rest
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-01-12 10:20:16 +0300
committerGravatar Vitaly Takmazov2018-01-12 10:20:16 +0300
commit8b245d2df742321b575cb8295518f6e22790ba87 (patch)
tree3e882564c7134106ad8ffbb806c1b8605df1ac36 /juick-crosspost/src/main/java/com/juick/service/rest
parent170503cf246d2d3f1b99f9adb26fa181690646c6 (diff)
api: merge crosspost application
Diffstat (limited to 'juick-crosspost/src/main/java/com/juick/service/rest')
-rw-r--r--juick-crosspost/src/main/java/com/juick/service/rest/CrosspostRestService.java143
1 files changed, 0 insertions, 143 deletions
diff --git a/juick-crosspost/src/main/java/com/juick/service/rest/CrosspostRestService.java b/juick-crosspost/src/main/java/com/juick/service/rest/CrosspostRestService.java
deleted file mode 100644
index dbc0bdc9..00000000
--- a/juick-crosspost/src/main/java/com/juick/service/rest/CrosspostRestService.java
+++ /dev/null
@@ -1,143 +0,0 @@
-package com.juick.service.rest;
-
-import com.juick.ExternalToken;
-import com.juick.User;
-import com.juick.server.helpers.ApplicationStatus;
-import com.juick.service.CrosspostService;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.tuple.Pair;
-import org.springframework.stereotype.Component;
-import org.springframework.web.client.RestTemplate;
-
-import javax.inject.Inject;
-import java.util.Optional;
-
-@Component
-public class CrosspostRestService implements CrosspostService {
- @Inject
- private RestTemplate rest;
-
- @Override
- public Optional<ExternalToken> getTwitterToken(int uid) {
- User user = rest.getForObject("https://api.juick.com/tokens?uid={uid}", User.class, uid);
- if (user != null) {
- return user.getTokens().stream()
- .filter(t -> t.getType().equals("twitter")).findFirst();
- }
- return Optional.empty();
- }
-
- @Override
- public boolean deleteTwitterToken(Integer uid) {
- return false;
- }
-
- @Override
- public Optional<Pair<String, String>> getFacebookTokens(int uid) {
- return Optional.empty();
- }
-
- @Override
- public ApplicationStatus getFbCrossPostStatus(int uid) {
- return null;
- }
-
- @Override
- public boolean enableFBCrosspost(Integer uid) {
- return false;
- }
-
- @Override
- public void disableFBCrosspost(Integer uid) {
-
- }
-
- @Override
- public String getTwitterName(int uid) {
- ExternalToken token = getTwitterToken(uid).orElse(null);
- if (token != null) {
- return token.getName();
- }
- return StringUtils.EMPTY;
- }
-
- @Override
- public String getTelegramName(int uid) {
- return null;
- }
-
- @Override
- public Optional<Pair<String, String>> getVkTokens(int uid) {
- return null;
- }
-
- @Override
- public void deleteVKUser(Integer uid) {
-
- }
-
- @Override
- public int getUIDbyFBID(long fbID) {
- return 0;
- }
-
- @Override
- public boolean createFacebookUser(long fbID, String loginhash, String token, String fbName, String fbLink) {
- return false;
- }
-
- @Override
- public boolean updateFacebookUser(long fbID, String token, String fbName, String fbLink) {
- return false;
- }
-
- @Override
- public int getUIDbyVKID(long vkID) {
- return 0;
- }
-
- @Override
- public boolean createVKUser(long vkID, String loginhash, String token, String vkName, String vkLink) {
- return false;
- }
-
- @Override
- public String getFacebookNameByHash(String hash) {
- return null;
- }
-
- @Override
- public String getTelegramNameByHash(String hash) {
- return null;
- }
-
- @Override
- public boolean setFacebookUser(String hash, int uid) {
- return false;
- }
-
- @Override
- public String getVKNameByHash(String hash) {
- return null;
- }
-
- @Override
- public boolean setVKUser(String hash, int uid) {
- return false;
- }
-
- @Override
- public boolean setTelegramUser(String hash, int uid) {
- return false;
- }
-
- @Override
- public String getJIDByHash(String hash) {
- return null;
- }
-
- @Override
- public boolean setJIDUser(String hash, int uid) {
- return false;
- }
-}