Przeglądaj źródła

管理员根据idAudio来搜索音频

yaobo 7 lat temu
rodzic
commit
e1796b0810

+ 6 - 1
src/main/java/cn/efunbox/audio/controller/AudioController.java

@@ -58,6 +58,7 @@ public class AudioController {
      */
     @RequestMapping(value = "/admsearch", method = RequestMethod.POST)
     public void AdminSearch(HttpServletRequest request, HttpServletResponse response){
+        String idAudio = request.getParameter("idAudio");
         String mediaType = request.getParameter("mediaType");
         String name = request.getParameter("name");
         String album = request.getParameter("album");
@@ -73,7 +74,11 @@ public class AudioController {
 
         Map<String,Object> map = new HashMap<>();
         List<Audio> list = null;
-        if(idGroup!=null && idGroup.length()>0){
+        if(idAudio!=null && idAudio.length()>0){
+            Audio audio = audioService.GetOne(Long.valueOf(idAudio));
+            list = new ArrayList<Audio>();
+            list.add(audio);
+        }else if(idGroup!=null && idGroup.length()>0){
             Page<Audio> pageRes = audioService.SearchByIdGroup(Integer.valueOf(mediaType), Long.valueOf(idGroup), Integer.valueOf(page), Integer.valueOf(size));
             map.put("data", pageRes.getContent());
             map.put("size", pageRes.getNumberOfElements());