ExamController.java 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package cn.com.qmth.examcloud.app.controller;
  2. import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_KEY;
  3. import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
  4. import javax.validation.Valid;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.GetMapping;
  7. import org.springframework.web.bind.annotation.ModelAttribute;
  8. import org.springframework.web.bind.annotation.PathVariable;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.RequestHeader;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
  14. import cn.com.qmth.examcloud.app.model.Result;
  15. import cn.com.qmth.examcloud.app.service.CoreOeService;
  16. import cn.com.qmth.examcloud.web.support.ControllerSupport;
  17. import io.swagger.annotations.Api;
  18. import io.swagger.annotations.ApiOperation;
  19. @RestController
  20. @RequestMapping("${$rmp}/v2/exam")
  21. @Api(tags = "考试相关接口")
  22. public class ExamController extends ControllerSupport {
  23. @Autowired
  24. private CoreOeService oeService;
  25. @ApiOperation(value = "查询考生的考试批次属性集")
  26. @GetMapping("getExamProperty/{examId}/{keys}")
  27. public Result getExamPropertyFromCacheByStudentSession(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examId,
  28. @PathVariable String keys) throws Exception{
  29. return oeService.getExamPropertyFromCacheByStudentSession(key, token, examId, keys);
  30. }
  31. /**
  32. * 获取云存储上传签名(微信小程序调用)
  33. */
  34. @ApiOperation(value = "获取文件上传签名")
  35. @PostMapping("/yunSignature")
  36. public Result getYunSignature(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@ModelAttribute @Valid GetYunSignatureReq req) throws Exception{
  37. return oeService.getYunSignature(key, token, req);
  38. }
  39. @ApiOperation(value = "获取在线考试待考列表")
  40. @GetMapping("/queryExamList")
  41. public Result queryExamList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token) throws Exception{
  42. return oeService.queryExamList(key, token);
  43. }
  44. @ApiOperation(value = "获取考试记录信息")
  45. @GetMapping("/getEndExamInfo/{examRecordDataId}")
  46. public Result getEndExamInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examRecordDataId) throws Exception{
  47. return oeService.getEndExamInfo(key, token,examRecordDataId);
  48. }
  49. @ApiOperation(value = "根据examStudentId获取客观分信息")
  50. @GetMapping("/queryObjectiveScoreList/{examStudentId}")
  51. public Result queryObjectiveScoreList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token,@PathVariable Long examStudentId) throws Exception{
  52. return oeService.queryObjectiveScoreList(key, token,examStudentId);
  53. }
  54. }