diff options
author | Vitaly Takmazov | 2019-04-29 11:33:37 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-04-29 11:33:37 +0300 |
commit | db25e044786dc98aaa4e56700d4bbddb7d97ca2e (patch) | |
tree | 974fae4dbaaca67f1232e622c6e7df6701552092 /src/main/java/com/juick/server | |
parent | 57bbef026ee44c0e52680f4bb101df6fa6431303 (diff) |
rss test
Diffstat (limited to 'src/main/java/com/juick/server')
-rw-r--r-- | src/main/java/com/juick/server/api/rss/Feeds.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/juick/server/api/rss/Feeds.java b/src/main/java/com/juick/server/api/rss/Feeds.java index 47d9fd5e..d6e0587c 100644 --- a/src/main/java/com/juick/server/api/rss/Feeds.java +++ b/src/main/java/com/juick/server/api/rss/Feeds.java @@ -18,15 +18,13 @@ package com.juick.server.api.rss; import com.juick.User; -import com.juick.server.util.HttpBadRequestException; import com.juick.server.util.HttpNotFoundException; import com.juick.server.util.UserUtils; import com.juick.service.MessagesService; import com.juick.service.UserService; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -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.servlet.ModelAndView; @@ -44,7 +42,7 @@ public class Feeds { @Inject private UserService userService; - @RequestMapping(value = "/rss/{userName}/blog", method = RequestMethod.GET, produces = "text/xml; charset=utf-8") + @GetMapping("/rss/{userName}/blog") public ModelAndView getBlog(@PathVariable String userName) { User user = userService.getUserByName(userName); if (!user.isAnonymous() && !user.isBanned()) { @@ -58,7 +56,7 @@ public class Feeds { throw new HttpNotFoundException(); } - @RequestMapping(value = "/rss/", method = RequestMethod.GET, produces = "text/xml; charset=utf-8") + @GetMapping("/rss/") public ModelAndView getLast(@RequestParam(value = "hours", required = false, defaultValue = "0") Integer hours) { List<Integer> mids = messagesService.getLastMessages(hours); ModelAndView modelAndView = new ModelAndView(); @@ -66,7 +64,7 @@ public class Feeds { modelAndView.addObject("messages", messagesService.getMessages(UserUtils.getCurrentUser(),mids)); return modelAndView; } - @RequestMapping(value = "/rss/comments", method = RequestMethod.GET, produces = "text/xml; charset=utf-8") + @GetMapping("/rss/comments") public ModelAndView getLastReplies(@RequestParam(value = "hours", required = false, defaultValue = "0") Integer hours) { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("repliesView"); |