1.fix collect empty issue

main
Gary 10 months ago
parent 06af19e1b0
commit 1fda200534

@ -91,6 +91,9 @@ public class JournalController {
@PathVariable @VerifyParam(required = true)Integer pageNum,
@PathVariable @VerifyParam(required = true)Integer pageSize) {
List<String> objectIds=userCollectService.getCollectList(userId,pageNum,pageSize,CollectTypeEnum.JOURNAL);
if(objectIds.isEmpty()) {
return Result.success(new PageResult<JournalRespDTO>(0L, Collections.emptyList()));
}
List<Article> pageList = articleService.orderByField(objectIds);
Set<String> journalCollectSet = objectIds.isEmpty()?Collections.emptySet(): new HashSet<>(objectIds);
List<JournalRespDTO> list = pageList.stream().map(a -> getJournalRespDTO(a, journalCollectSet))

@ -85,6 +85,9 @@ public class SongController {
@PathVariable @VerifyParam(required = true) Integer pageNum,
@PathVariable @VerifyParam(required = true) Integer pageSize) {
List<String> objectIds = userCollectService.getCollectList(userId, pageNum, pageSize, CollectTypeEnum.SONG);
if(objectIds.isEmpty()) {
return Result.success(new PageResult<SongRespDTO>(0L, Collections.emptyList()));
}
List<Song> songs = songService.orderByField(objectIds);
Set<String> songCollectSet = objectIds.isEmpty() ? Collections.emptySet() : new HashSet<>(objectIds);

Loading…
Cancel
Save