1.speed up query

main
Gary 10 months ago
parent 8167f62b08
commit 79f667451c

@ -111,7 +111,7 @@ public class JournalController {
List<Journal> pageList = journalService.orderByField(objectIds); List<Journal> pageList = journalService.orderByField(objectIds);
Set<String> journalCollectSet = new HashSet<>(objectIds); Set<String> journalCollectSet = new HashSet<>(objectIds);
Map<String,List<String>> tagMap=tagService.getTagMap(objectIds); Map<String,List<String>> tagMap=tagService.getTagMap(objectIds);
List<JournalRespDTO> list = pageList.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet,mongoTemplate,redisTemplate,commentDao,tagMap)) List<JournalRespDTO> list = pageList.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet,tagMap))
.collect(Collectors.toList()); .collect(Collectors.toList());
return Result.success(new PageResult<JournalRespDTO>(Long.valueOf(list.size()), list)); return Result.success(new PageResult<JournalRespDTO>(Long.valueOf(list.size()), list));
} }
@ -176,7 +176,7 @@ public class JournalController {
Set<String> journalCollectSet = null == user ? Collections.emptySet() Set<String> journalCollectSet = null == user ? Collections.emptySet()
: userCollectInfoService.getCollectSet(user.getUserId(),ids, CollectTypeEnum.JOURNAL); : userCollectInfoService.getCollectSet(user.getUserId(),ids, CollectTypeEnum.JOURNAL);
Map<String,List<String>> tagMap=tagService.getTagMap(ids); Map<String,List<String>> tagMap=tagService.getTagMap(ids);
List<JournalRespDTO> list = journals.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet,mongoTemplate,redisTemplate,commentDao,tagMap)) List<JournalRespDTO> list = journals.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet,tagMap))
.collect(Collectors.toList()); .collect(Collectors.toList());
return Result.success(list); return Result.success(list);

Loading…
Cancel
Save