Explorar o código

提交APP接口

weiwenhai %!s(int64=6) %!d(string=hai) anos
pai
achega
1874e9a75c

+ 9 - 9
src/main/java/cn/com/qmth/examcloud/app/controller/PracticeExamRestController.java

@@ -45,8 +45,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "获取当前练习的剩余作答时间接口")
     @RequestMapping(value = "/exam/record/heartbeat", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result getExamRecordHeartbeat(@RequestHeader String key, @RequestHeader String token, @RequestParam String examRecordId) throws Exception {
-        return netExamService.getExamRecordHeartbeat(key, token, examRecordId);
+    public Result getExamRecordHeartbeat(@RequestHeader String key, @RequestHeader String token) throws Exception {
+        return netExamService.getExamRecordHeartbeat(key, token);
     }
 
     @ApiOperation(value = "考生“开始练习”接口")
@@ -69,14 +69,14 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "获取当前练习的试卷试题列表接口")
     @RequestMapping(value = "/exam/record/paper/question/list", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result getExamRecordPaperQuestionList(@RequestHeader String key, @RequestHeader String token, @RequestParam String examRecordId) throws Exception {
-        return netExamService.getExamRecordPaperQuestionList(key, token, examRecordId);
+    public Result getExamRecordPaperQuestionList(@RequestHeader String key, @RequestHeader String token) throws Exception {
+        return netExamService.getExamRecordPaperQuestionList(key, token);
     }
 
     @ApiOperation(value = "获取考生作答的某个试题的详细信息接口")
-    @RequestMapping(value = "/exam/record/paper/question/detail/{questionId}", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result questionDetail(@RequestHeader String key, @RequestHeader String token, @PathVariable String questionId) throws Exception {
-        return netExamService.getExamRecordPaperQuestionDetail(key, token, questionId);
+    @RequestMapping(value = "/exam/record/paper/question/detail/{questionId}/{examRecordId}", method = {RequestMethod.GET, RequestMethod.POST})
+    public Result questionDetail(@RequestHeader String key, @RequestHeader String token, @PathVariable String questionId, @PathVariable String examRecordId) throws Exception {
+        return netExamService.getExamRecordPaperQuestionDetail(key, token, questionId, examRecordId);
     }
 
     @ApiOperation(value = "保存或更新考生作答的某个试题答案接口")
@@ -87,8 +87,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "当前练习的交卷接口")
     @RequestMapping(value = "/exam/record/submit", method = {RequestMethod.GET, RequestMethod.POST})
-    public Result submitPracticeExamRecord(@RequestHeader String key, @RequestHeader String token, @RequestParam String examRecordId) throws Exception {
-        return netExamService.submitPracticeExamRecord(key, token, examRecordId);
+    public Result submitPracticeExamRecord(@RequestHeader String key, @RequestHeader String token) throws Exception {
+        return netExamService.submitPracticeExamRecord(key, token);
     }
 
     @ApiOperation(value = "检查考生当前是否有正在进行的练习记录接口")

+ 4 - 4
src/main/java/cn/com/qmth/examcloud/app/service/NetExamService.java

@@ -82,7 +82,7 @@ public interface NetExamService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordHeartbeat(String key, String token, String examRecordId) throws Exception;
+    Result getExamRecordHeartbeat(String key, String token) throws Exception;
 
     /**
      * 考生“开始练习”
@@ -115,7 +115,7 @@ public interface NetExamService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordPaperQuestionList(String key, String token, String examRecordId) throws Exception;
+    Result getExamRecordPaperQuestionList(String key, String token) throws Exception;
 
     /**
      * 获取考生作答的某个试题的详细信息
@@ -126,7 +126,7 @@ public interface NetExamService {
      * @return
      * @throws Exception
      */
-    Result getExamRecordPaperQuestionDetail(String key, String token, String questionId) throws Exception;
+    Result getExamRecordPaperQuestionDetail(String key, String token, String questionId, String examRecordId) throws Exception;
 
     /**
      * 保存或更新考生作答的某个试题答案
@@ -149,7 +149,7 @@ public interface NetExamService {
      * @return
      * @throws Exception
      */
-    Result submitPracticeExamRecord(String key, String token, String examRecordId) throws Exception;
+    Result submitPracticeExamRecord(String key, String token) throws Exception;
 
     /**
      * 检查考生当前是否有正在进行的练习记录

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/app/service/impl/ExamAdminServiceImpl.java

@@ -31,7 +31,7 @@ public class ExamAdminServiceImpl implements ExamAdminService {
     @Override
     public Result getPracticeExamList(String key, String token, String studentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_exam_work/exam_student/query?student_id=%s", propertyService.getExamAdminUrl(), studentId);
+        final String requestUrl = String.format("%s/api/ecs_exam_work/exam/queryByNameLike?name=&examTypes=PRACTICE&studentId=%s", propertyService.getExamAdminUrl(), studentId);
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         if (result.isSuccess()) {
             String data = result.getData();

+ 14 - 13
src/main/java/cn/com/qmth/examcloud/app/service/impl/NetExamServiceImpl.java

@@ -19,6 +19,7 @@ import okhttp3.FormBody;
 import okhttp3.MediaType;
 import okhttp3.MultipartBody;
 import okhttp3.RequestBody;
+
 import org.apache.commons.io.FilenameUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -94,42 +95,42 @@ public class NetExamServiceImpl implements NetExamService {
     @Override
     public Result getPracticeExamCourseList(String key, String token, String examId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/practice_course?examId=%s", propertyService.getNetExamUrl(), examId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/practice/queryPracticeCourseList?examId=%s", propertyService.getNetExamUrl(), examId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
-    public Result getExamRecordHeartbeat(String key, String token, String examRecordId) throws Exception {
+    public Result getExamRecordHeartbeat(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_control/heartbeat?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/examHeartbeat", propertyService.getNetExamUrl());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
     public Result startPracticeExamRecord(String key, String token, String examStudentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_control/start?stu_exam_info_id=%s", propertyService.getNetExamUrl(), examStudentId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/startExam?examStudentId=%s", propertyService.getNetExamUrl(), examStudentId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
     public Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_question/paper_struct?exam_record_id=%s", propertyService.getNetExamUrl(), examRecordId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", propertyService.getNetExamUrl(), examRecordId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
-    public Result getExamRecordPaperQuestionList(String key, String token, String examRecordId) throws Exception {
+    public Result getExamRecordPaperQuestionList(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_question?exam_record_id=%s", propertyService.getNetExamUrl(), examRecordId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examQuestion/findExamQuestionList", propertyService.getNetExamUrl());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
-    public Result getExamRecordPaperQuestionDetail(String key, String token, String questionId) throws Exception {
+    public Result getExamRecordPaperQuestionDetail(String key, String token, String questionId, String examRecordId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_question/question?question_id=%s", propertyService.getNetExamUrl(), questionId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examQuestion/getQuestionContent?questionId=%s&exam_record_id=%s", propertyService.getNetExamUrl(), questionId,examRecordId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
@@ -146,16 +147,16 @@ public class NetExamServiceImpl implements NetExamService {
     }
 
     @Override
-    public Result submitPracticeExamRecord(String key, String token, String examRecordId) throws Exception {
+    public Result submitPracticeExamRecord(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_control/submit?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/endExam", propertyService.getNetExamUrl());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
     public Result checkOnlineExamRecord(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/exam_record/checkExam", propertyService.getNetExamUrl());
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/checkExamInProgress", propertyService.getNetExamUrl());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
@@ -169,7 +170,7 @@ public class NetExamServiceImpl implements NetExamService {
     @Override
     public Result getExamRecordPracticeHistoryList(String key, String token, String examStudentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/practice_record?examStudentId=%s", propertyService.getNetExamUrl(), examStudentId);
+        final String requestUrl = String.format("%s/api/ecs_oe_student/practice/queryPracticeRecordList?examStudentId=%s", propertyService.getNetExamUrl(), examStudentId);
         return HttpUtils.doGet(requestUrl, key, token);
     }