|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -17,9 +18,11 @@ import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.bean.PaperK12Bean;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetDefaultQuesionsReq;
|
|
|
+import cn.com.qmth.examcloud.core.questions.api.request.GetExtractConfigReq;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetPaperReq;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetQuestionListReq;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.response.GetPaperResp;
|
|
|
+import cn.com.qmth.examcloud.core.questions.dao.entity.ExtractConfig;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.Question;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperProviderService;
|
|
|
import cn.com.qmth.examcloud.question.core.paper.DefaultPaper;
|
|
@@ -54,11 +57,26 @@ public class DefaultPaperController extends ControllerSupport {
|
|
|
@PostMapping("/findPaper")
|
|
|
public ResponseEntity<Object> findPaper(@RequestBody GetPaperReq req){
|
|
|
String paperId = req.getPaperId();
|
|
|
- if(null == paperId){
|
|
|
+ if(StringUtils.isBlank(paperId)){
|
|
|
throw new StatusException("Q-016057", "paperId is null");
|
|
|
}
|
|
|
DefaultPaper defaultPaper = paperProviderService.findPaper(paperId);
|
|
|
return new ResponseEntity<Object>(defaultPaper,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "外部接口查询试卷", notes = "外部接口查询试卷")
|
|
|
+ @PostMapping("/findExamPaper")
|
|
|
+ public ResponseEntity<Object> findExamPaper(@RequestBody GetExtractConfigReq req){
|
|
|
+ String rootOrgId = req.getRootOrgId();
|
|
|
+ if(StringUtils.isBlank(rootOrgId)){
|
|
|
+ throw new StatusException("Q-016068", "rootOrgId is null");
|
|
|
+ }
|
|
|
+ Long examId = req.getExamId();
|
|
|
+ if(null == examId){
|
|
|
+ throw new StatusException("Q-016073", "examId is null");
|
|
|
+ }
|
|
|
+ DefaultPaper defaultPaper = paperProviderService.findExamPaper(rootOrgId,examId);
|
|
|
+ return new ResponseEntity<Object>(defaultPaper,HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
}
|