Controllers migration.

master
Rémi Cocula 8 years ago
parent 97be70531e
commit f90de5e310
  1. 26
      libresonic-main/src/main/java/org/libresonic/player/controller/SetMusicFileInfoController.java
  2. 4
      libresonic-main/src/main/resources/libresonic-servlet.xml

@ -19,28 +19,33 @@
*/ */
package org.libresonic.player.controller; package org.libresonic.player.controller;
import javax.servlet.http.HttpServletRequest; import org.libresonic.player.domain.MediaFile;
import javax.servlet.http.HttpServletResponse; import org.libresonic.player.service.MediaFileService;
import org.libresonic.player.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.ServletRequestUtils; 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.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.view.RedirectView; import org.springframework.web.servlet.view.RedirectView;
import org.libresonic.player.domain.MediaFile; import javax.servlet.http.HttpServletRequest;
import org.libresonic.player.service.MediaFileService;
import org.libresonic.player.util.StringUtil;
/** /**
* Controller for updating music file metadata. * Controller for updating music file metadata.
* *
* @author Sindre Mehus * @author Sindre Mehus
*/ */
public class SetMusicFileInfoController extends AbstractController { @Controller
@RequestMapping("/setMusicFileInfo")
public class SetMusicFileInfoController {
@Autowired
private MediaFileService mediaFileService; private MediaFileService mediaFileService;
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { @RequestMapping(method = RequestMethod.GET)
protected ModelAndView handleRequestInternal(HttpServletRequest request) throws Exception {
int id = ServletRequestUtils.getRequiredIntParameter(request, "id"); int id = ServletRequestUtils.getRequiredIntParameter(request, "id");
String action = request.getParameter("action"); String action = request.getParameter("action");
@ -55,7 +60,4 @@ public class SetMusicFileInfoController extends AbstractController {
return new ModelAndView(new RedirectView(url)); return new ModelAndView(new RedirectView(url));
} }
public void setMediaFileService(MediaFileService mediaFileService) {
this.mediaFileService = mediaFileService;
}
} }

@ -15,9 +15,6 @@
<mvc:annotation-driven /> <mvc:annotation-driven />
<context:component-scan base-package="org.libresonic.player.controller, org.libresonic.player.validator"/> <context:component-scan base-package="org.libresonic.player.controller, org.libresonic.player.validator"/>
<bean id="setMusicFileInfoController" class="org.libresonic.player.controller.SetMusicFileInfoController">
<property name="mediaFileService" ref="mediaFileService"/>
</bean>
<bean id="shareManagementController" class="org.libresonic.player.controller.ShareManagementController"> <bean id="shareManagementController" class="org.libresonic.player.controller.ShareManagementController">
<property name="settingsService" ref="settingsService"/> <property name="settingsService" ref="settingsService"/>
<property name="mediaFileService" ref="mediaFileService"/> <property name="mediaFileService" ref="mediaFileService"/>
@ -189,7 +186,6 @@
<property name="mappings"> <property name="mappings">
<props> <props>
<prop key="/exportPlaylist.view">multiController</prop> <prop key="/exportPlaylist.view">multiController</prop>
<prop key="/setMusicFileInfo.view">setMusicFileInfoController</prop>
<prop key="/createShare.view">shareManagementController</prop> <prop key="/createShare.view">shareManagementController</prop>
<prop key="/setRating.view">setRatingController</prop> <prop key="/setRating.view">setRatingController</prop>
<prop key="/changeCoverArt.view">changeCoverArtController</prop> <prop key="/changeCoverArt.view">changeCoverArtController</prop>

Loading…
Cancel
Save