瀏覽代碼

管理员根据idAudio来搜索音频

yaobo 7 年之前
父節點
當前提交
e1796b0810
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/main/java/cn/efunbox/audio/controller/AudioController.java

+ 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());