新增了扫描url的工具方法
This commit is contained in:
@@ -25,13 +25,12 @@ import java.util.List;
|
||||
import static com.yutou.nas.Datas.AppData.defaultMusicPath;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/nas/music/")
|
||||
public class MusicController {
|
||||
|
||||
@Resource
|
||||
MusicToolsServiceImpl musicTools;
|
||||
|
||||
@RequestMapping("all.do")
|
||||
@RequestMapping("/nas/music/all.do")
|
||||
@ResponseBody
|
||||
public String getAllMusicList() {
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -42,7 +41,7 @@ public class MusicController {
|
||||
return json.toJSONString();
|
||||
}
|
||||
|
||||
@RequestMapping("list.do")
|
||||
@RequestMapping("/nas/music/list.do")
|
||||
@ResponseBody
|
||||
public String getMusicListOfPath(@RequestBody JSONObject body) {
|
||||
String path = body.getString("path");
|
||||
@@ -65,7 +64,7 @@ public class MusicController {
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("getAlbum.do")
|
||||
@RequestMapping("/nas/music/getAlbum.do")
|
||||
public String getAlbum(@RequestBody JSONObject body) {
|
||||
String album = body.getString("album");
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -79,7 +78,7 @@ public class MusicController {
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("getArtist.do")
|
||||
@RequestMapping("/nas/music/getArtist.do")
|
||||
public String getArtist(@RequestBody JSONObject body) {
|
||||
String artist = body.getString("artist");
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -92,7 +91,7 @@ public class MusicController {
|
||||
return json.toJSONString();
|
||||
}
|
||||
|
||||
@RequestMapping("reload.do")
|
||||
@RequestMapping("/nas/music/reload.do")
|
||||
@ResponseBody
|
||||
public String reload() {
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -102,7 +101,7 @@ public class MusicController {
|
||||
return json.toJSONString();
|
||||
}
|
||||
|
||||
@RequestMapping("find/file.do")
|
||||
@RequestMapping("/nas/music/find/file.do")
|
||||
@ResponseBody
|
||||
public String findFile(@RequestBody JSONObject body) {
|
||||
String path = body.getString("path");
|
||||
@@ -120,7 +119,7 @@ public class MusicController {
|
||||
return json.toJSONString();
|
||||
}
|
||||
|
||||
@RequestMapping("getlocalhost.do")
|
||||
@RequestMapping("/nas/music/getlocalhost.do")
|
||||
@ResponseBody
|
||||
public String getLocalHost() {
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -133,7 +132,7 @@ public class MusicController {
|
||||
return json.toJSONString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "web/image.do", produces = MediaType.IMAGE_JPEG_VALUE)
|
||||
@RequestMapping(value = "/nas/music/web/image.do", produces = MediaType.IMAGE_JPEG_VALUE)
|
||||
@ResponseBody
|
||||
public byte[] getImage(String fileName, String type) {
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -146,7 +145,7 @@ public class MusicController {
|
||||
return getImage(json);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "image.do", produces = MediaType.IMAGE_JPEG_VALUE)
|
||||
@RequestMapping(value = "/nas/music/image.do", produces = MediaType.IMAGE_JPEG_VALUE)
|
||||
@ResponseBody
|
||||
public byte[] getImage(@RequestBody JSONObject body) {
|
||||
String fileName = body.getString("fileName");
|
||||
@@ -172,7 +171,7 @@ public class MusicController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping("random.do")
|
||||
@RequestMapping("/nas/music/random.do")
|
||||
@ResponseBody
|
||||
public String random() {
|
||||
List<MusicData> list = musicTools.getMusicList();
|
||||
@@ -192,7 +191,7 @@ public class MusicController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("play.do")
|
||||
@RequestMapping("/nas/music/play.do")
|
||||
public ResponseEntity<FileSystemResource> play(String filePath, String random) {
|
||||
String _filePath;
|
||||
boolean _random;
|
||||
|
||||
Reference in New Issue
Block a user