diff --git a/luoo_music/src/main/java/com/luoo/music/service/UserCollectService.java b/luoo_music/src/main/java/com/luoo/music/service/UserCollectService.java index bc71cae..35058b6 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/UserCollectService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/UserCollectService.java @@ -47,9 +47,13 @@ public class UserCollectService { return Collections.emptyList(); } } + private List getPageResult(Integer pageNum, Integer pageSize, LinkedList objectIds) { + if (null == pageNum || null == pageSize) { + return objectIds; + } int end = pageNum * pageSize; - if (null != pageNum && null != pageSize && pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { + if (pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { return objectIds.subList((pageNum - 1) * pageSize, end); } return objectIds; diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserCollectService.java b/luoo_user/src/main/java/com/luoo/user/service/UserCollectService.java index 82f0b9f..c205ed5 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserCollectService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserCollectService.java @@ -127,8 +127,11 @@ public class UserCollectService { } private List getPageResult(Integer pageNum, Integer pageSize, LinkedList objectIds) { + if (null == pageNum || null == pageSize) { + return objectIds; + } int end = pageNum * pageSize; - if (null != pageNum && null != pageSize && pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { + if (pageNum > 0 && pageSize > 0 && end <= objectIds.size()) { return objectIds.subList((pageNum - 1) * pageSize, end); } return objectIds;