Browse Source

Merge branch 'branch_other'

deason 5 years ago
parent
commit
3e53ab171f

+ 65 - 0
src/main/java/cn/com/qmth/examcloud/app/controller/ExamController.java

@@ -0,0 +1,65 @@
+package cn.com.qmth.examcloud.app.controller;
+
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_KEY;
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
+import cn.com.qmth.examcloud.app.model.Result;
+import cn.com.qmth.examcloud.app.service.CoreOeService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("${$rmp}/v2/exam")
+@Api(tags = "考试相关接口")
+public class ExamController extends ControllerSupport {
+
+    @Autowired
+    private CoreOeService oeService;
+
+	@ApiOperation(value = "查询考生的考试批次属性集")
+	@GetMapping("getExamProperty/{examId}/{keys}")
+	public Result getExamPropertyFromCacheByStudentSession(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examId,
+			@PathVariable String keys) throws Exception{
+	    return oeService.getExamPropertyFromCacheByStudentSession(key, token, examId, keys);
+	}
+	/**
+     * 获取云存储上传签名(微信小程序调用)
+     */
+    @ApiOperation(value = "获取文件上传签名")
+    @PostMapping("/yunSignature")
+    public Result getYunSignature(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@ModelAttribute @Valid GetYunSignatureReq req) throws Exception{
+        return oeService.getYunSignature(key, token, req);
+    }
+    
+    @ApiOperation(value = "获取在线考试待考列表")
+    @GetMapping("/queryExamList")
+    public Result queryExamList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token) throws Exception{
+        return oeService.queryExamList(key, token);
+    }
+    
+    @ApiOperation(value = "获取考试记录信息")
+    @GetMapping("/getEndExamInfo/{examRecordDataId}")
+    public Result getEndExamInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examRecordDataId) throws Exception{
+        return oeService.getEndExamInfo(key, token,examRecordDataId);
+    }
+    
+    @ApiOperation(value = "根据examStudentId获取客观分信息")
+    @GetMapping("/queryObjectiveScoreList/{examStudentId}")
+    public Result queryObjectiveScoreList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examStudentId) throws Exception{
+        return oeService.queryObjectiveScoreList(key, token,examStudentId);
+    }
+
+}

+ 35 - 0
src/main/java/cn/com/qmth/examcloud/app/controller/PaperController.java

@@ -0,0 +1,35 @@
+package cn.com.qmth.examcloud.app.controller;
+
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_KEY;
+import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.app.model.Result;
+import cn.com.qmth.examcloud.app.service.CoreOeService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("${$rmp}/v2/paper")
+@Api(tags = "试卷相关接口")
+public class PaperController extends ControllerSupport {
+
+    @Autowired
+    private CoreOeService oeService;
+
+	@ApiOperation(value = "根据Id获取试卷")
+	@GetMapping("{paperId}")
+	public Result getPaperById(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,
+			@PathVariable String paperId) throws Exception{
+	    return oeService.getPaperById(key, token,paperId);
+	}
+
+
+}

+ 68 - 0
src/main/java/cn/com/qmth/examcloud/app/model/GetYunSignatureReq.java

@@ -0,0 +1,68 @@
+package cn.com.qmth.examcloud.app.model;
+
+import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+public class GetYunSignatureReq implements JsonSerializable {
+	/**
+     * 
+     */
+    private static final long serialVersionUID = 4523536593807014828L;
+    @NotNull(message = "考试记录DataID不能为空")
+    @ApiModelProperty(required = true, value = "考试记录DataID")
+    private String examRecordDataId;
+    @NotNull(message = "题号不能为空")
+    @ApiModelProperty(required = true, value = "考试试题号")
+    private String order;
+    @NotNull(message = "文件MD5不能为空")
+    @ApiModelProperty(required = true, value = "文件MD5")
+    private String fileMd5;
+    @NotNull(message = "文件后缀不能为空")
+    @ApiModelProperty(required = true, value = "文件后缀")
+    private String fileSuffix;
+    @ApiModelProperty(value = "文件名自定义参数")
+    private String ext;
+
+    public String getExamRecordDataId() {
+        return examRecordDataId;
+    }
+
+    public void setExamRecordDataId(String examRecordDataId) {
+        this.examRecordDataId = examRecordDataId;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public String getFileMd5() {
+        return fileMd5;
+    }
+
+    public void setFileMd5(String fileMd5) {
+        this.fileMd5 = fileMd5;
+    }
+
+    public String getFileSuffix() {
+        return fileSuffix;
+    }
+
+    public void setFileSuffix(String fileSuffix) {
+        this.fileSuffix = fileSuffix;
+    }
+
+    public String getExt() {
+        return ext;
+    }
+
+    public void setExt(String ext) {
+        this.ext = ext;
+    }
+
+}