From fc77902b14c16e7c911a0f2fe6a73e69b252f699 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 13 Nov 2017 15:23:06 +0300 Subject: notifications: moved top service from cron --- juick-api/src/main/java/com/juick/api/controllers/Messages.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'juick-api/src/main/java/com/juick/api/controllers') 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 topCandidates() { + User visitor = UserUtils.getCurrentUser(); + if ((visitor.getUid() == 0) || !(visitor.getName().equals("juick"))) { + throw new HttpForbiddenException(); + } + return messagesService.getPopularCandidates(); + } @ApiIgnore @RequestMapping("/messages/set_popular") -- cgit v1.2.3