Prechádzať zdrojové kódy

feat:修复了获得收藏交流的bug

DingXiaoYu 3 rokov pred
rodič
commit
18e043b984

+ 2 - 3
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/serviceImpl/CommunicationServiceImpl.java

@@ -191,9 +191,8 @@ public class CommunicationServiceImpl implements CommunicationService {
     public PageVO<CommunicationVO> getStarredCommunicationPage(Long userId, Integer page, Integer size) {
         Pageable pageable = PageRequest.of(page,size);
         Page<CommunicationStar> communicationStars=communicationStarRepository.findByUserId(userId,pageable);
-        Page<Communication> communications=new PageImpl<>(communicationStars.getContent().stream().map(
-                communicationStar -> communicationRepository.findById(communicationStar.getCommunicationId()).get()
-        ).collect(Collectors.toList()),pageable,communicationStars.getTotalElements());
+        Page<Communication> communications=communicationStars.map(
+                communicationStar -> communicationRepository.findById(communicationStar.getCommunicationId()).get());
         return toPageVO(communications,userId);
     }