deason 7 年之前
父節點
當前提交
4a217cc838

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

@@ -25,7 +25,7 @@ public class ExamAdminService {
 
     public Result getPracticeExamList(String key, String token, String studentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getExamAdminUrl() + "/api/ecs_exam_work/exam_student/query?student_id=%s", studentId);
+        final String requestUrl = String.format("%s/api/ecs_exam_work/exam_student/query?student_id=%s", propertyService.getExamAdminUrl(), studentId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 

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

@@ -35,7 +35,7 @@ public class NetExamService {
 
     public Result getCurrentTime(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getNetExamUrl() + "/api/online_exam_course/currentTime";
+        final String requestUrl = String.format("%s/api/online_exam_course/currentTime", propertyService.getNetExamUrl());
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         if (result.isSuccess()) {
             //转换日期格式
@@ -46,13 +46,13 @@ public class NetExamService {
 
     public Result getOfflineExamCourseList(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getNetExamUrl() + "/api/offline_exam/getOfflineCourse";
+        final String requestUrl = String.format("%s/api/offline_exam/getOfflineCourse", propertyService.getNetExamUrl());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     public Result startOfflineExamRecord(String key, String token, String examStudentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/offline_exam/start?examStudentId=%s", examStudentId);
+        final String requestUrl = String.format("%s/api/offline_exam/start?examStudentId=%s", propertyService.getNetExamUrl(), examStudentId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
@@ -67,7 +67,7 @@ public class NetExamService {
             throw new ApiException("File must be not empty.");
         }
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/offline_exam/%s/submit", examRecordId);
+        final String requestUrl = String.format("%s/api/offline_exam/%s/submit", propertyService.getNetExamUrl(), examRecordId);
         MultipartBody.Builder form = new MultipartBody.Builder().setType(MultipartBody.FORM);
         RequestBody body = RequestBody.create(MediaType.parse("application/octet-stream"), fileBytes);
         form.addFormDataPart("file", fileName, body);
@@ -78,24 +78,26 @@ public class NetExamService {
 
     public Result getPracticeExamCourseList(String key, String token, String examId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/practice_course?examId=%s", examId);
+        final String requestUrl = String.format("%s/api/practice_course?examId=%s", propertyService.getNetExamUrl(), examId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     public Result getExamRecordHeartbeat(String key, String token, String examRecordId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/exam_control/heartbeat?examRecordId=%s", examRecordId);
+        final String requestUrl = String.format("%s/api/exam_control/heartbeat?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     public Result startPracticeExamRecord(String key, String token, String examStudentId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getNetExamUrl() + "/api/exam_control/start?stu_exam_info_id=%s", examStudentId);
+        final String requestUrl = String.format("%s/api/exam_control/start?stu_exam_info_id=%s", propertyService.getNetExamUrl(), examStudentId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     public Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception {
-        return null;
+        //封装请求参数
+        final String requestUrl = String.format("%s/api/exam_control/start?examRecordId=%s", propertyService.getNetExamUrl(), examRecordId);
+        return HttpUtils.doGet(requestUrl, key, token);
     }
 
     public Result getExamRecordPaperQuestionList(String key, String token, String examRecordId) throws Exception {

+ 2 - 2
src/main/java/cn/com/qmth/examcloud/app/service/QuestionPoolService.java

@@ -25,12 +25,12 @@ public class QuestionPoolService {
 
     public String downloadPaper(String paperId, String orgName) throws Exception {
         //封装请求参数
-        return String.format(propertyService.getQuestionPoolUrl() + "/api/ecs_ques/paper/export/%s/PAPER/%s/%s/offLine", paperId, orgName, paperId);
+        return String.format("%s/api/ecs_ques/paper/export/%s/PAPER/%s/%s/offLine", propertyService.getQuestionPoolUrl(), paperId, orgName, paperId);
     }
 
     public Result getPaperDetail(String key, String token, String paperId) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format(propertyService.getQuestionPoolUrl() + "/api/ecs_ques/paper/%s", paperId);
+        final String requestUrl = String.format("%s/api/ecs_ques/paper/%s", propertyService.getQuestionPoolUrl(), paperId);
         return HttpUtils.doGet(requestUrl, key, token);
     }
 

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

@@ -23,7 +23,7 @@ public class UpYunService {
 
     public String downloadPaperAnswer(String filePath) throws Exception {
         //封装请求参数
-        return String.format(propertyService.getUpYunUrl() + "/%s", filePath);
+        return String.format("%s/%s", propertyService.getUpYunUrl(), filePath);
     }
 
 }

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

@@ -35,7 +35,7 @@ public class UserAuthService {
 
     public Result login(String account, String password, Long rootOrgId) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/auth/login";
+        final String requestUrl = String.format("%s/api/ecs_core/auth/login", propertyService.getUserAuthUrl());
         Map<String, String> params = new HashMap<>();
         params.put("accountValue", account);
         params.put("password", password);
@@ -65,7 +65,7 @@ public class UserAuthService {
 
     public Result logout(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/auth/logout";
+        final String requestUrl = String.format("%s/api/ecs_core/auth/logout", propertyService.getUserAuthUrl());
         RequestBody formBody = new FormBody.Builder()
                 .add(PARAM_KEY, key)
                 .add(PARAM_TOKEN, token)
@@ -75,7 +75,7 @@ public class UserAuthService {
 
     public Result getUserInfo(String key, String token) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/auth/getLoginUser";
+        final String requestUrl = String.format("%s/api/ecs_core/auth/getLoginUser", propertyService.getUserAuthUrl());
         RequestBody formBody = new FormBody.Builder()
                 .add(PARAM_KEY, key)
                 .add(PARAM_TOKEN, token)
@@ -85,7 +85,7 @@ public class UserAuthService {
 
     public Result updatePassword(String key, String token, Long userId, String password) throws Exception {
         //封装请求参数
-        final String requestUrl = propertyService.getUserAuthUrl() + "/api/ecs_core/user/password";
+        final String requestUrl = String.format("%s/api/ecs_core/user/password", propertyService.getUserAuthUrl());
         RequestBody formBody = new FormBody.Builder()
                 .add("userId", String.valueOf(userId))
                 .add("password", password)