From 97be70531e53fff7ce7e539bd95b27d03fcb048b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Sat, 17 Dec 2016 19:15:00 +0100 Subject: [PATCH] Controllers migration. --- .../PodcastReceiverAdminController.java | 20 +++++++++---------- .../src/main/resources/libresonic-servlet.xml | 4 ---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastReceiverAdminController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastReceiverAdminController.java index 7c7858c2..f3b19093 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastReceiverAdminController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/PodcastReceiverAdminController.java @@ -19,32 +19,35 @@ */ package org.libresonic.player.controller; +import org.apache.commons.lang.StringUtils; import org.libresonic.player.domain.PodcastEpisode; import org.libresonic.player.domain.PodcastStatus; import org.libresonic.player.service.PodcastService; import org.libresonic.player.util.StringUtil; -import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; import org.springframework.web.bind.ServletRequestUtils; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.AbstractController; import org.springframework.web.servlet.view.RedirectView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; /** * Controller for the "Podcast receiver" page. * * @author Sindre Mehus */ -public class PodcastReceiverAdminController extends AbstractController { +@Controller +@RequestMapping("/podcastReceiverAdmin") +public class PodcastReceiverAdminController { + @Autowired private PodcastService podcastService; - @Override + @RequestMapping(method = RequestMethod.GET) protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { Integer channelId = ServletRequestUtils.getIntParameter(request, "channelId"); @@ -93,7 +96,4 @@ public class PodcastReceiverAdminController extends AbstractController { } } - public void setPodcastService(PodcastService podcastService) { - this.podcastService = podcastService; - } } diff --git a/libresonic-main/src/main/resources/libresonic-servlet.xml b/libresonic-main/src/main/resources/libresonic-servlet.xml index 814eca82..fc15cd5b 100644 --- a/libresonic-main/src/main/resources/libresonic-servlet.xml +++ b/libresonic-main/src/main/resources/libresonic-servlet.xml @@ -15,9 +15,6 @@ - - - @@ -216,7 +213,6 @@ downloadController dbController multiController - podcastReceiverAdminController podcastController downloadController wapController