|
|
@ -12,11 +12,9 @@ import com.luoo.music.response.cms.SongVO;
|
|
|
|
import com.luoo.music.util.Constants;
|
|
|
|
import com.luoo.music.util.Constants;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
|
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
@ -234,7 +232,7 @@ public class CMSJournalService {
|
|
|
|
String image = param.getImage();
|
|
|
|
String image = param.getImage();
|
|
|
|
String suffix = image.substring(image.lastIndexOf(Constants.DOT));
|
|
|
|
String suffix = image.substring(image.lastIndexOf(Constants.DOT));
|
|
|
|
String destKeySuffix = String.format("%05d/00%s", Integer.parseInt(param.getJournalNo()), suffix);
|
|
|
|
String destKeySuffix = String.format("%05d/00%s", Integer.parseInt(param.getJournalNo()), suffix);
|
|
|
|
String destKey = Constants.MUSIC_RESOURCE_PREFIX + destKeySuffix;
|
|
|
|
String destKey = Constants.MUSIC_KEY_PREFIX + destKeySuffix;
|
|
|
|
int copy = s3Service.copy(Constants.BUCKET, srcKey, destKey);
|
|
|
|
int copy = s3Service.copy(Constants.BUCKET, srcKey, destKey);
|
|
|
|
if (copy > 0) {
|
|
|
|
if (copy > 0) {
|
|
|
|
return destKeySuffix;
|
|
|
|
return destKeySuffix;
|
|
|
@ -273,9 +271,9 @@ public class CMSJournalService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void batchSaveJournalRelatesInfo(String journalId, JournalAddModel param) {
|
|
|
|
private void batchSaveJournalRelatesInfo(String journalId, JournalAddModel param) {
|
|
|
|
// 标签信息
|
|
|
|
// 标签信息
|
|
|
|
if (!CollectionUtils.isEmpty(param.getTags())) {
|
|
|
|
if (!CollectionUtils.isEmpty(param.getTag())) {
|
|
|
|
List<JournalTag> journalTagList = new ArrayList<>();
|
|
|
|
List<JournalTag> journalTagList = new ArrayList<>();
|
|
|
|
for (String item : param.getTags()) {
|
|
|
|
for (String item : param.getTag()) {
|
|
|
|
JournalTag journalTag = new JournalTag();
|
|
|
|
JournalTag journalTag = new JournalTag();
|
|
|
|
journalTag.setId(String.valueOf(idWorker.nextId()));
|
|
|
|
journalTag.setId(String.valueOf(idWorker.nextId()));
|
|
|
|
journalTag.setJournalId(journalId);
|
|
|
|
journalTag.setJournalId(journalId);
|
|
|
@ -292,16 +290,18 @@ public class CMSJournalService {
|
|
|
|
int num = 0;
|
|
|
|
int num = 0;
|
|
|
|
for (String item : param.getSongs()) {
|
|
|
|
for (String item : param.getSongs()) {
|
|
|
|
if (idSongMap.containsKey(item)) {
|
|
|
|
if (idSongMap.containsKey(item)) {
|
|
|
|
|
|
|
|
num += 1;
|
|
|
|
SongInfo song = idSongMap.get(item);
|
|
|
|
SongInfo song = idSongMap.get(item);
|
|
|
|
JournalSong journalSong = new JournalSong();
|
|
|
|
JournalSong journalSong = new JournalSong();
|
|
|
|
journalSong.setId(String.valueOf(idWorker.nextId()));
|
|
|
|
journalSong.setId(String.valueOf(idWorker.nextId()));
|
|
|
|
journalSong.setName(song.getName());
|
|
|
|
journalSong.setName(song.getName());
|
|
|
|
|
|
|
|
journalSong.setAlbum(song.getAlbum());
|
|
|
|
journalSong.setArtist(song.getArtist());
|
|
|
|
journalSong.setArtist(song.getArtist());
|
|
|
|
journalSong.setUrl(song.getUrl());
|
|
|
|
journalSong.setUrl(song.getUrl());
|
|
|
|
journalSong.setImage(song.getImage());
|
|
|
|
journalSong.setImage(song.getImage());
|
|
|
|
journalSong.setSongId(item);
|
|
|
|
journalSong.setSongId(item);
|
|
|
|
journalSong.setJournalNo(param.getJournalNo());
|
|
|
|
journalSong.setJournalNo(param.getJournalNo());
|
|
|
|
journalSong.setSongNo(num + 1);
|
|
|
|
journalSong.setSongNo(num);
|
|
|
|
journalSong.setSongId(song.getId());
|
|
|
|
journalSong.setSongId(song.getId());
|
|
|
|
journalSongList.add(journalSong);
|
|
|
|
journalSongList.add(journalSong);
|
|
|
|
}
|
|
|
|
}
|
|
|
|