aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/server/api/rss/Feeds.java10
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");