From 2bb026b96849b3ac4ee033b2c91884b55e1e9e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Cocula?= Date: Thu, 22 Dec 2016 21:47:31 +0100 Subject: [PATCH] Controller migration --- .../player/controller/AvatarController.java | 14 +++++++++----- .../src/main/resources/libresonic-servlet.xml | 4 ---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libresonic-main/src/main/java/org/libresonic/player/controller/AvatarController.java b/libresonic-main/src/main/java/org/libresonic/player/controller/AvatarController.java index a8f10951..18ba9f3f 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/controller/AvatarController.java +++ b/libresonic-main/src/main/java/org/libresonic/player/controller/AvatarController.java @@ -22,9 +22,12 @@ package org.libresonic.player.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +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.Controller; import org.springframework.web.servlet.mvc.LastModified; import org.libresonic.player.domain.Avatar; @@ -37,8 +40,11 @@ import org.libresonic.player.service.SettingsService; * * @author Sindre Mehus */ -public class AvatarController implements Controller, LastModified { +@Controller +@RequestMapping("/avatar") +public class AvatarController implements LastModified { + @Autowired private SettingsService settingsService; public long getLastModified(HttpServletRequest request) { @@ -54,6 +60,7 @@ public class AvatarController implements Controller, LastModified { return result; } + @RequestMapping(method = RequestMethod.GET) public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Avatar avatar = getAvatar(request); @@ -87,7 +94,4 @@ public class AvatarController implements Controller, LastModified { return settingsService.getSystemAvatar(userSettings.getSystemAvatarId()); } - public void setSettingsService(SettingsService settingsService) { - this.settingsService = settingsService; - } } \ No newline at end of file diff --git a/libresonic-main/src/main/resources/libresonic-servlet.xml b/libresonic-main/src/main/resources/libresonic-servlet.xml index e19ca95e..00671755 100644 --- a/libresonic-main/src/main/resources/libresonic-servlet.xml +++ b/libresonic-main/src/main/resources/libresonic-servlet.xml @@ -15,9 +15,6 @@ - - - @@ -129,7 +126,6 @@ multiController multiController videoPlayerController - avatarController proxyController statusChartController userChartController