1.remove invalid cache in journal query page

main
Gary 5 months ago
parent 734121bd36
commit fb7ea2ae13

@ -70,6 +70,9 @@ public class JournalController {
UserLoginDto user = jwtUtil.getUserLoginDto(authorization);
updateQuery(deviceType,user,queryReq);
Long count = journalService.countJournal(queryReq);
if(0==count) {
return Result.success(new PageResult<JournalRespDTO>(count, Collections.emptyList()));
}
List<JournalRespDTO> pageList=journalService.queryJournalByPage(queryReq);
Set<String> journalCollectSet = getJournalCollectSet(user);
updateCollectStatus(pageList,journalCollectSet);
@ -115,6 +118,9 @@ public class JournalController {
return Result.success(new PageResult<JournalRespDTO>(0L, Collections.emptyList()));
}
Long count = Long.valueOf(getJournalCollectSet(queryReq.getUserId()).size());
if(0==count) {
return Result.success(new PageResult<JournalRespDTO>(count, Collections.emptyList()));
}
List<Journal> pageList = journalService.orderByField(objectIds);
UserLoginDto user = jwtUtil.getUserLoginDto(authorization);
Set<String> journalCollectSet = getMyCollectSet(user.getUserId(),queryReq.getUserId(),objectIds);

@ -109,6 +109,9 @@ public class SongController {
return Result.success(new PageResult<SongRespDTO>(0L, Collections.emptyList()));
}
Long count = (long) getSongCollectSet(queryUserId).size();
if(0==count) {
return Result.success(new PageResult<SongRespDTO>(count, Collections.emptyList()));
}
List<JournalSong> songs = journalSongService.orderByField(objectIds);
Set<String> songCollectSet = getMyCollectSet(loginUserId,queryUserId,objectIds,isJouranlSource);
List<SongRespDTO> results = songs.stream().map(s -> SongMapper.getSongRespDTO(s, songCollectSet))

@ -357,9 +357,9 @@ public class JournalService {
@SuppressWarnings("unchecked")
public List<JournalRespDTO> queryJournalByPage(JournalQueryReq queryReq) {
if(StringTools.isEmpty(queryReq.getCategoryId())&&StringTools.isEmpty(queryReq.getJournalNoRange())) {
return (List<JournalRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, queryReq.toString(), key -> getJournalRespDTOWithComment(queryReq) , true).getValue() ;
return (List<JournalRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, queryReq.toString(), key -> getJournalRespDTOWithComment(queryReq) , false).getValue() ;
}
List<JournalRespDTO> list= (List<JournalRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, queryReq.toString(), key -> getJournalRespDTO(queryReq) , true).getValue() ;
List<JournalRespDTO> list= (List<JournalRespDTO>) this.cacheChannel.get(Constants.J2CACHE_REGION_JOURNAL_QUERY_PAGE, queryReq.toString(), key -> getJournalRespDTO(queryReq) , false).getValue() ;
list.parallelStream().forEach(j->{
updateComment(j);
});

Loading…
Cancel
Save