From 8b245d2df742321b575cb8295518f6e22790ba87 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 12 Jan 2018 10:20:16 +0300 Subject: api: merge crosspost application --- .../juick/service/rest/CrosspostRestService.java | 143 --------------------- 1 file changed, 143 deletions(-) delete mode 100644 juick-crosspost/src/main/java/com/juick/service/rest/CrosspostRestService.java (limited to 'juick-crosspost/src/main/java/com/juick/service/rest') 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 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> 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> 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; - } -} -- cgit v1.2.3