|
@@ -4,9 +4,13 @@ import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.PaperCloudService;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetExtractConfigReq;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.request.GetQuestionListReq;
|
|
|
+import cn.com.qmth.examcloud.core.questions.api.request.GetRandomPaperReq;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.response.GetCommonResp;
|
|
|
import cn.com.qmth.examcloud.core.questions.api.response.GetPaperResp;
|
|
|
+import cn.com.qmth.examcloud.core.questions.api.response.GetRandomPaperResp;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperProviderService;
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.RandomPaperService;
|
|
|
+import cn.com.qmth.examcloud.question.commons.core.paper.DefaultPaper;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -32,7 +36,10 @@ public class PaperCloudServiceProvider implements PaperCloudService {
|
|
|
private static final long serialVersionUID = -7354673848303599874L;
|
|
|
|
|
|
@Autowired
|
|
|
- PaperProviderService paperProviderService;
|
|
|
+ private PaperProviderService paperProviderService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RandomPaperService randomPaperService;
|
|
|
|
|
|
@ApiOperation(value = "外部接口组卷", notes = "外部接口组卷")
|
|
|
@PostMapping("/genPaper")
|
|
@@ -70,4 +77,17 @@ public class PaperCloudServiceProvider implements PaperCloudService {
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("随机抽卷")
|
|
|
+ @PostMapping("randompaper")
|
|
|
+ @Override
|
|
|
+ public GetRandomPaperResp getRandomPaper(@RequestBody GetRandomPaperReq req) {
|
|
|
+ if (StringUtils.isBlank(req.getRandomPaperId())) {
|
|
|
+ throw new StatusException("RandomPaperId is null");
|
|
|
+ }
|
|
|
+ GetRandomPaperResp res=new GetRandomPaperResp();
|
|
|
+ DefaultPaper defaultPaper=randomPaperService.getRandomPaper(req.getRandomPaperId());
|
|
|
+ res.setDefaultPaper(defaultPaper);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
}
|