diff --git a/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java b/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java index 396e712..7392d2e 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java @@ -91,6 +91,9 @@ public class JournalController { @PathVariable @VerifyParam(required = true)Integer pageNum, @PathVariable @VerifyParam(required = true)Integer pageSize) { List objectIds=userCollectService.getCollectList(userId,pageNum,pageSize,CollectTypeEnum.JOURNAL); + if(objectIds.isEmpty()) { + return Result.success(new PageResult(0L, Collections.emptyList())); + } List
pageList = articleService.orderByField(objectIds); Set journalCollectSet = objectIds.isEmpty()?Collections.emptySet(): new HashSet<>(objectIds); List list = pageList.stream().map(a -> getJournalRespDTO(a, journalCollectSet)) diff --git a/luoo_music/src/main/java/com/luoo/music/controller/SongController.java b/luoo_music/src/main/java/com/luoo/music/controller/SongController.java index c4878b9..1135081 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/SongController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/SongController.java @@ -85,6 +85,9 @@ public class SongController { @PathVariable @VerifyParam(required = true) Integer pageNum, @PathVariable @VerifyParam(required = true) Integer pageSize) { List objectIds = userCollectService.getCollectList(userId, pageNum, pageSize, CollectTypeEnum.SONG); + if(objectIds.isEmpty()) { + return Result.success(new PageResult(0L, Collections.emptyList())); + } List songs = songService.orderByField(objectIds); Set songCollectSet = objectIds.isEmpty() ? Collections.emptySet() : new HashSet<>(objectIds);