From 40b67e7f1078e0514f76322c66c334dede5cea60 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 18 Oct 2021 22:18:52 +0300 Subject: Added user RSS feed with recommendations --- src/main/java/com/juick/www/rss/Feeds.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/juick/www/rss') diff --git a/src/main/java/com/juick/www/rss/Feeds.java b/src/main/java/com/juick/www/rss/Feeds.java index 18d5639b..34ad7e5e 100644 --- a/src/main/java/com/juick/www/rss/Feeds.java +++ b/src/main/java/com/juick/www/rss/Feeds.java @@ -42,11 +42,16 @@ public class Feeds { @Inject private UserService userService; - @GetMapping("/rss/{userName}/blog") - public ModelAndView getBlog(@Visitor User visitor, @PathVariable String userName) { + public enum FeedType { + blog, + feed + } + + @GetMapping("/rss/{userName}/{feedType}") + public ModelAndView getBlog(@Visitor User visitor, @PathVariable String userName, @PathVariable FeedType feedType) { User user = userService.getUserByName(userName); if (!user.isAnonymous() && !user.isBanned()) { - List mids = messagesService.getUserBlog(user.getUid(), 0, 0); + List mids = feedType == FeedType.blog ? messagesService.getUserBlog(user.getUid(), 0, 0) : messagesService.getUserBlogWithRecommendations(user.getUid(), 0, 0); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("messagesView"); modelAndView.addObject("user", user); -- cgit v1.2.3