|
|
|
@ -78,13 +78,13 @@ public class JournalController {
|
|
|
|
|
UserLoginDto user = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
|
updateQuery(user,queryReq);
|
|
|
|
|
List<JournalRespDTO> pageList=journalService.queryJournalByPage(queryReq);
|
|
|
|
|
pageList = pageList.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
// pageList = pageList.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
Set<String> journalCollectSet = getJournalCollectSet(user);
|
|
|
|
|
updateCollectStatus(pageList,journalCollectSet);
|
|
|
|
|
return Result.success(new PageResult<JournalRespDTO>(Long.valueOf(pageList.size()), pageList));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private JournalRespDTO randomCDN(JournalRespDTO journalRespDTO) {
|
|
|
|
|
private JournalRespDTO randomCDN1(JournalRespDTO journalRespDTO) {
|
|
|
|
|
// Random random = new Random();
|
|
|
|
|
// int randomNum = random.nextInt(2)+1;
|
|
|
|
|
|
|
|
|
@ -145,7 +145,7 @@ public class JournalController {
|
|
|
|
|
Set<String> journalCollectSet = getMyCollectSet(user.getUserId(),queryReq.getUserId(),objectIds);
|
|
|
|
|
List<JournalRespDTO> list = pageList.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
list = list.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
// list = list.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
return Result.success(new PageResult<JournalRespDTO>(Long.valueOf(list.size()), list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,7 +237,7 @@ public class JournalController {
|
|
|
|
|
|
|
|
|
|
boolean isCollect=null == user ? false:userCollectInfoService.isCollect(user.getUserId(),id, CollectTypeEnum.JOURNAL);
|
|
|
|
|
journalRespDTO.setHaveCollect(isCollect);
|
|
|
|
|
journalRespDTO = randomCDN(journalRespDTO);
|
|
|
|
|
// journalRespDTO = randomCDN(journalRespDTO);
|
|
|
|
|
return Result.success(journalRespDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ public class JournalController {
|
|
|
|
|
}
|
|
|
|
|
boolean isCollect=null == user ? false:userCollectInfoService.isCollect(user.getUserId(),journalRespDTO.getId(), CollectTypeEnum.JOURNAL);
|
|
|
|
|
journalRespDTO.setHaveCollect(isCollect);
|
|
|
|
|
journalRespDTO = randomCDN(journalRespDTO);
|
|
|
|
|
// journalRespDTO = randomCDN(journalRespDTO);
|
|
|
|
|
return Result.success(journalRespDTO);
|
|
|
|
|
}
|
|
|
|
|
private boolean isLatest10(String journalNo) {
|
|
|
|
@ -289,7 +289,7 @@ public class JournalController {
|
|
|
|
|
: userCollectInfoService.getCollectSet(user.getUserId(),ids, CollectTypeEnum.JOURNAL);
|
|
|
|
|
List<JournalRespDTO> list = journals.stream().map(a -> JournalMapper.getJournalRespDTO(a, journalCollectSet))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
list = list.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
// list = list.stream().map(journalRespDTO -> randomCDN(journalRespDTO)).collect(Collectors.toList());
|
|
|
|
|
return Result.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|