/** * 主题颜色 * * @param url * @return */ @RequestMapping("color") public String color(String url) { return String.format("var cont = '%s';", musicService.color(url).replace("'", "\\'")); }
/** * 歌曲详情 * * @param id * @param callback * @return */ @RequestMapping("song") public String getSongInfo(String id, String callback) { Song song = musicService.song(id); return String.format("%s(%s)", callback, JSON.toJSONString(song)); }
/** * 歌词 * * @param lrc 歌曲ID * @return */ @RequestMapping("lyric") public String lyric(String lrc) { String lyric = musicService.lyric(lrc) + "''"; return String.format("var cont = '%s';", lyric.replace("'", "\\'")); }
/** * 歌单列表 * * @param ids * @return */ @RequestMapping("playlist") public String getPlayList(String ids) { List<PlayList> playLists = musicService.playLists(ids.split(",|\\|")); return String.format("var wenkmList = %s", JSON.toJSONString(playLists)); }