|
|
|
@ -90,14 +90,14 @@ public class CMSSongService {
|
|
|
|
|
response.setArtist(item.getArtist());
|
|
|
|
|
response.setAlbum(item.getAlbum());
|
|
|
|
|
response.setTags(songTagMap.get(id));
|
|
|
|
|
response.setImage(item.getImage());
|
|
|
|
|
response.setImage(Constants.SONG_RESOURCE_PREFIX + item.getImage());
|
|
|
|
|
response.setSize(CommonUtil.formatSongSize(item.getSize()));
|
|
|
|
|
response.setDuration(CommonUtil.formatSongDuration(item.getDuration()));
|
|
|
|
|
response.setJournal(songJournalMap.get(id));
|
|
|
|
|
response.setUpdateTime(item.getUpdateTime().format(Constants.formatter));
|
|
|
|
|
response.setState(item.getState());
|
|
|
|
|
response.setUserId(item.getUserId());
|
|
|
|
|
response.setUrl(item.getUrl());
|
|
|
|
|
response.setUrl(Constants.SONG_RESOURCE_PREFIX + item.getUrl());
|
|
|
|
|
result.add(response);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -180,7 +180,8 @@ public class CMSSongService {
|
|
|
|
|
}
|
|
|
|
|
if (idTagMap.keySet().contains(tagId)) {
|
|
|
|
|
Tag tag = idTagMap.get(tagId);
|
|
|
|
|
list.add(tag.getNameCh());
|
|
|
|
|
// list.add(tag.getNameCh());
|
|
|
|
|
list.add(tag.getId());
|
|
|
|
|
}
|
|
|
|
|
result.put(songId, list);
|
|
|
|
|
}
|
|
|
|
@ -319,6 +320,7 @@ public class CMSSongService {
|
|
|
|
|
*/
|
|
|
|
|
public Result update(String id, String token, SongAddModel param) {
|
|
|
|
|
SongInfo song = buildSong(id, param, token);
|
|
|
|
|
SongInfo oldSong = songDao.findById(id).get();
|
|
|
|
|
String url = null;
|
|
|
|
|
if (param.getUrl().contains(Constants.TEMP_KEY_PREFIX)) {
|
|
|
|
|
url = moveSongFile(id, param);
|
|
|
|
@ -328,6 +330,10 @@ public class CMSSongService {
|
|
|
|
|
song.setUrl(url);
|
|
|
|
|
song.setSize(param.getSize());
|
|
|
|
|
song.setDuration(param.getDuration());
|
|
|
|
|
} else {
|
|
|
|
|
song.setUrl(oldSong.getUrl());
|
|
|
|
|
song.setSize(oldSong.getSize());
|
|
|
|
|
song.setDuration(oldSong.getDuration());
|
|
|
|
|
}
|
|
|
|
|
String image = null;
|
|
|
|
|
if (param.getImage().contains(Constants.TEMP_KEY_PREFIX)) {
|
|
|
|
@ -336,8 +342,9 @@ public class CMSSongService {
|
|
|
|
|
Result.failed("更新失败");
|
|
|
|
|
}
|
|
|
|
|
song.setImage(image);
|
|
|
|
|
} else {
|
|
|
|
|
song.setImage(oldSong.getImage());
|
|
|
|
|
}
|
|
|
|
|
SongInfo oldSong = songDao.findById(id).get();
|
|
|
|
|
song.setState(oldSong.getState());
|
|
|
|
|
songDao.save(song);
|
|
|
|
|
songTagDao.deleteBySongId(id);
|
|
|
|
|