diff options
Diffstat (limited to 'src/main/java/com/juick/www/rss/Feeds.java')
-rw-r--r-- | src/main/java/com/juick/www/rss/Feeds.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/juick/www/rss/Feeds.java b/src/main/java/com/juick/www/rss/Feeds.java index 41b006a6..4e64bc5a 100644 --- a/src/main/java/com/juick/www/rss/Feeds.java +++ b/src/main/java/com/juick/www/rss/Feeds.java @@ -22,6 +22,7 @@ import com.juick.util.HttpNotFoundException; import com.juick.service.MessagesService; import com.juick.service.UserService; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.core.convert.ConversionFailedException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -49,7 +50,7 @@ public class Feeds { } @GetMapping("/rss/{userName}/{feedType}") - public ModelAndView getBlog(@ModelAttribute User visitor, @PathVariable String userName, @PathVariable FeedType feedType) { + public ModelAndView getBlog(@Parameter(hidden = true) User visitor, @PathVariable String userName, @PathVariable FeedType feedType) { User user = userService.getUserByName(userName); if (!user.isAnonymous() && !user.isBanned()) { List<Integer> mids = feedType == FeedType.blog ? messagesService.getUserBlog(user.getUid(), 0, 0) : messagesService.getUserBlogWithRecommendations(user, visitor, 0, 0); @@ -65,11 +66,12 @@ public class Feeds { @GetMapping("/rss/") public ModelAndView getLast( - @ModelAttribute User visitor, + @Parameter(hidden = true) User visitor, @RequestParam(value = "hours", required = false, defaultValue = "0") Integer hours) { List<Integer> mids = messagesService.getLastMessages(hours); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("messagesView"); + modelAndView.addObject("user", visitor); modelAndView.addObject("messages", messagesService.getMessages(visitor, mids)); return modelAndView; } |