|
@@ -1,24 +1,21 @@
|
|
|
package cn.com.qmth.examcloud.core.questions.api.provider;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
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;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
* @author weiwenhai
|
|
@@ -37,9 +34,6 @@ public class PaperCloudServiceProvider implements PaperCloudService {
|
|
|
|
|
|
@Autowired
|
|
|
private PaperProviderService paperProviderService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private RandomPaperService randomPaperService;
|
|
|
|
|
|
@ApiOperation(value = "外部接口组卷", notes = "外部接口组卷")
|
|
|
@PostMapping("/genPaper")
|
|
@@ -77,17 +71,5 @@ 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;
|
|
|
- }
|
|
|
|
|
|
}
|