From 1047824db23b641179211c129f4d682d0537a75b Mon Sep 17 00:00:00 2001 From: Gary Date: Mon, 18 Mar 2024 02:02:28 +0800 Subject: [PATCH] 1.update cache key --- .../src/main/java/constants/Constants.java | 1 + .../com/luoo/music/dto/mapper/SongMapper.java | 20 ------------------- .../music/service/JournalSongService.java | 2 +- 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/luoo_common/src/main/java/constants/Constants.java b/luoo_common/src/main/java/constants/Constants.java index 52b6545..fcbcb41 100644 --- a/luoo_common/src/main/java/constants/Constants.java +++ b/luoo_common/src/main/java/constants/Constants.java @@ -13,6 +13,7 @@ public class Constants { public static final String J2CACHE_REGION_JOURNAL_QUERY_PAGE = "journal_query_page"; public static final String J2CACHE_REGION_JOURNAL_ID = "journal_id"; public static final String J2CACHE_REGION_JOURNAL_NO = "journal_no"; + public static final String J2CACHE_REGION_JOURNAL_NO_SONG_ID = "journal_song_key"; public static final String J2CACHE_REGION_JOURNAL_SONG_LIST = "journal_song_list"; public static final String J2CACHE_REGION_JOURNAL_COMMENT_PAGE_HOT = "journal_comment_page_hot"; diff --git a/luoo_music/src/main/java/com/luoo/music/dto/mapper/SongMapper.java b/luoo_music/src/main/java/com/luoo/music/dto/mapper/SongMapper.java index 93e17c4..c9f2348 100644 --- a/luoo_music/src/main/java/com/luoo/music/dto/mapper/SongMapper.java +++ b/luoo_music/src/main/java/com/luoo/music/dto/mapper/SongMapper.java @@ -33,24 +33,4 @@ public class SongMapper { public static SongRespDTO getSongRespDTO(JournalSong song) { return getSongRespDTO(song, Collections.emptySet()); } - - public static SongRespDTO getSongRespDTO(SongInfo song, Set songCollectSet) { - SongRespDTO songRespDTO = new SongRespDTO(); - songRespDTO.setAlbum(song.getAlbum()); - songRespDTO.setArtist(song.getArtist()); - songRespDTO.setId(song.getId()); - songRespDTO.setTitle(song.getName()); - songRespDTO.setSrc(Constants.SONG_RESOURCE_PREFIX + song.getUrl()); - songRespDTO.setPic(Constants.SONG_RESOURCE_PREFIX + song.getImage()); - String lyric=song.getLyricUrl(); - if(!StringTools.isEmpty(lyric)) { - songRespDTO.setLrc(Constants.SONG_RESOURCE_PREFIX + lyric); - } - songRespDTO.setHaveCollect(songCollectSet.contains(songRespDTO.getId())); - return songRespDTO; - } - - public static SongRespDTO getSongRespDTO(SongInfo song) { - return getSongRespDTO(song, Collections.emptySet()); - } } diff --git a/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java b/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java index 0d66399..98396d3 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/JournalSongService.java @@ -115,7 +115,7 @@ public class JournalSongService { } public JournalSong findByJournalNoSongId(String id) { - return (JournalSong) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, id, key -> journalSongDao.findByJournalNoSongId(id) , false).getValue() ; + return (JournalSong) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_NO_SONG_ID, id, key -> journalSongDao.findByJournalNoSongId(id) , false).getValue() ; } public List findByJournalNo(String journalNo) {