weiwenhai 6 лет назад
Родитель
Сommit
06f166b483

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

@@ -169,4 +169,10 @@ public class PracticeExamRestController {
     public Result getFreezeTime(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam Long examId) throws Exception {
         return examAdminService.getFreezeTime(key, token, examId);
     }
+    
+    @ApiOperation(value = "获取文件上传类型")
+    @RequestMapping(value = "/exam/practice/getUpLoadType/{examId}", method = {RequestMethod.GET, RequestMethod.POST})
+    public Result getUpLoadType(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examId) throws Exception {
+        return examAdminService.getUpLoadType(key, token, examId);
+    }
 }

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

@@ -60,5 +60,15 @@ public interface ExamAdminService {
      * @throws Exception
      */
     Result getFreezeTime(String key, String token, Long examId) throws Exception;
+    
+    /**
+     * 获取文件上传类型
+     * @param key
+     * @param token
+     * @param examId
+     * @return
+     * @throws Exception
+     */
+    Result getUpLoadType(String key, String token, Long examId) throws Exception;
 
 }

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

@@ -81,4 +81,16 @@ public class ExamAdminServiceImpl implements ExamAdminService {
         return result;
 	}
 
+	@Override
+	public Result getUpLoadType(String key, String token, Long examId) throws Exception {
+		//封装请求参数
+        final String requestUrl = String.format("%s/api/ecs_exam_work/exam/examOrgProperty/%s/OFFLINE_UPLOAD_FILE_TYPE", propertyService.getExamAdminUrl(), examId);
+        Result<String> result = HttpUtils.doGet(requestUrl, key, token);
+        if (result.isSuccess()) {
+            //过滤掉为空的属性
+            result.setData(HttpUtils.filterNullAttributes(result.getData()));
+        }
+        return result;
+	}
+
 }