Преглед изворни кода

fix: 修复题目查询接口

weijin пре 4 година
родитељ
комит
c7c18d9ec0

+ 1 - 1
src/main/java/com/nju/edu/eval/manager/QuestionManager.java

@@ -62,6 +62,6 @@ public class QuestionManager {
             knowledgeIds = questionThirdPartyService.getKnowledgeNode(knowledgeName)
                     .stream().map(KnowledgeNodeVO::getId).collect(Collectors.toList());
         }
-        return questionThirdPartyService.getQuestionList(stem, tags, knowledgeIds, PageRequest.of(pageNum, pageSize, Sort.by("id").ascending()));
+        return questionThirdPartyService.getQuestionList(stem, tags, knowledgeIds, PageRequest.of(pageNum, pageSize));
     }
 }

+ 3 - 4
src/main/java/com/nju/edu/eval/thirdparty/thirdpartyImpl/QuestionThirdPartyServiceImpl.java

@@ -54,10 +54,9 @@ public class QuestionThirdPartyServiceImpl implements QuestionThirdPartyService
 
     @Override
     public QuestionStemListVO getQuestionList(String stem, List<String> tags, List<String> knowledgeIds, Pageable pageable) {
-        //String stem, List<String> tags, List<QuestionType> types, List<Integer> weights, List<String> knowledgeIds, Pageable pageable
-//        Page<QuestionVO> questionVOPageList = client.getQuestionList(stem, tags, knowledgeIds, pageable);
-//        return new QuestionStemListVO(BeanCopyUtil.copyListProperties(questionVOPageList.toList(), QuestionStemVO::new), (int) questionVOPageList.getTotalElements());
-        return null;
+//        String stem, List<String> tags, List<QuestionType> types, List<Integer> weights, List<String> knowledgeIds, Pageable pageable
+        Page<QuestionVO> questionVOPageList = client.getQuestionList(stem, tags,null,null, knowledgeIds, pageable);
+        return new QuestionStemListVO(BeanCopyUtil.copyListProperties(questionVOPageList.toList(), QuestionStemVO::new), (int) questionVOPageList.getTotalElements());
     }
 
     @Override