diff options
author | Vitaly Takmazov | 2018-01-12 10:27:59 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-01-12 10:27:59 +0300 |
commit | 4b9186442839ab591ba04b6e2474edbcc3a2f6f8 (patch) | |
tree | b729d23a2a34c1f17c52b210a3bffd5956541ef5 /juick-api | |
parent | 8b245d2df742321b575cb8295518f6e22790ba87 (diff) |
api: drop outdated service method
Diffstat (limited to 'juick-api')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Service.java | 17 |
1 files changed, 4 insertions, 13 deletions
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; - } } |