From 4b9186442839ab591ba04b6e2474edbcc3a2f6f8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 12 Jan 2018 10:27:59 +0300 Subject: api: drop outdated service method --- .../main/java/com/juick/api/controllers/Service.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'juick-api/src/main/java/com/juick/api/controllers') diff --git a/juick-api/src/main/java/com/juick/api/controllers/Service.java b/juick-api/src/main/java/com/juick/api/controllers/Service.java index b3516391..9e7f3333 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Service.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Service.java @@ -17,7 +17,6 @@ package com.juick.api.controllers; -import com.juick.ExternalToken; import com.juick.Message; import com.juick.User; import com.juick.server.util.HttpBadRequestException; @@ -28,7 +27,10 @@ import com.juick.service.MessagesService; import com.juick.service.SubscriptionService; import com.juick.service.UserService; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; import javax.inject.Inject; @@ -69,15 +71,4 @@ public class Service { } throw new HttpBadRequestException(); } - @GetMapping("/tokens") - public User getTokensForUser(@RequestParam(defaultValue = "0") int uid) { - User visitor = UserUtils.getCurrentUser(); - if ((visitor.getUid() == 0) && !(visitor.getName().equals("juick"))) { - throw new HttpForbiddenException(); - } - User user = userService.getUserByUID(uid).orElseThrow(IllegalStateException::new); - crosspostService.getTwitterToken(uid).ifPresent( - t -> user.getTokens().add(t)); - return user; - } } -- cgit v1.2.3