|
|
@@ -30,11 +30,26 @@ public class QuestionService {
|
|
|
}
|
|
|
|
|
|
public PageableQuestionListVO findByIdIn(Collection<String> id, Pageable pageable) {
|
|
|
+ if(id==null||id.size()==0){
|
|
|
+ return PageableQuestionListVO.builder()
|
|
|
+ .questions(new ArrayList<>())
|
|
|
+ .page(
|
|
|
+ PageVO.builder()
|
|
|
+ .size(pageable.getPageSize())
|
|
|
+ .totalPages(0)
|
|
|
+ .totalElements(0L)
|
|
|
+ .number(0)
|
|
|
+ .build())
|
|
|
+ .build();
|
|
|
+ }
|
|
|
final Page<Question> questionPage = questionRepository.findByIdIn(id, pageable);
|
|
|
PageableQuestionListVO vos=PageableQuestionListVO.of(questionPage);
|
|
|
return vos;
|
|
|
}
|
|
|
public List<Question> findAllByIdIn(Collection<String> id) {
|
|
|
+ if(id==null||id.size()==0){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
final List<Question> questions = questionRepository.findAllByIdIn(id);
|
|
|
return questions;
|
|
|
}
|