diff options
author | Vitaly Takmazov | 2017-11-13 15:23:06 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-11-13 15:23:06 +0300 |
commit | fc77902b14c16e7c911a0f2fe6a73e69b252f699 (patch) | |
tree | 4e86783db9b588af9f98a8a3e56a48be7a6d53a5 /juick-api/src/main/java/com/juick/api/controllers | |
parent | 4f32ea8c6889be56861a290e633a89c5b6740e3a (diff) |
notifications: moved top service from cron
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Messages.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Messages.java b/juick-api/src/main/java/com/juick/api/controllers/Messages.java index 322effa3..5f00ee68 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Messages.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Messages.java @@ -178,6 +178,15 @@ public class Messages { } throw new HttpForbiddenException(); } + @ApiIgnore + @RequestMapping("/messages/top_candidates") + public List<Integer> topCandidates() { + User visitor = UserUtils.getCurrentUser(); + if ((visitor.getUid() == 0) || !(visitor.getName().equals("juick"))) { + throw new HttpForbiddenException(); + } + return messagesService.getPopularCandidates(); + } @ApiIgnore @RequestMapping("/messages/set_popular") |