|
|
@@ -16,10 +16,7 @@ import cn.seecoder.seecoderportalserver.service.CommunicationService;
|
|
|
import cn.seecoder.seecoderportalserver.service.UserService;
|
|
|
import cn.seecoder.seecoderportalserver.utility.OssUtil;
|
|
|
import cn.seecoder.seecoderportalserver.web.rest.errors.CustomErrorException;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
+import org.springframework.data.domain.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@@ -193,7 +190,10 @@ public class CommunicationServiceImpl implements CommunicationService {
|
|
|
@Override
|
|
|
public PageVO<CommunicationVO> getStarredCommunicationPage(Long userId, Integer page, Integer size) {
|
|
|
Pageable pageable = PageRequest.of(page,size);
|
|
|
- Page<Communication> communications=communicationRepository.findByStarUserId(userId,pageable);
|
|
|
+ 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());
|
|
|
return toPageVO(communications,userId);
|
|
|
}
|
|
|
|