|
@@ -5,13 +5,11 @@ import java.io.IOException;
|
|
|
import java.io.PrintWriter;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import javax.servlet.http.HttpSession;
|
|
|
|
|
|
import edu.nju.entities.*;
|
|
|
-import edu.nju.model.ExamVO;
|
|
|
import edu.nju.model.PageExamVO;
|
|
|
+import edu.nju.model.enums.CollaborativeType;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
@@ -250,7 +248,7 @@ public class ExtraController {
|
|
|
File dest = new File("/Users/guochao/Downloads/" + file_name);
|
|
|
if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
|
|
|
if(!file.isEmpty()) { file.transferTo(dest); }
|
|
|
- String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description);
|
|
|
+ String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description, CollaborativeType.IS_COLLABORATIVE.getId()+"");
|
|
|
return json;
|
|
|
} catch (IOException e) {
|
|
|
// TODO Auto-generated catch block
|
|
@@ -260,7 +258,7 @@ public class ExtraController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 创建任务
|
|
|
* @param file 文件oss的url
|
|
|
* @param file_name
|
|
|
* @param paper_type
|
|
@@ -268,14 +266,16 @@ public class ExtraController {
|
|
|
* @param test_type
|
|
|
* @param description
|
|
|
* @param app_name
|
|
|
+ * @param collaborative_type
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/uploadExamUrl", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public String uploadExamUrl(String file, String file_name, String paper_type,
|
|
|
- String case_id, String test_type, String description, String app_name) {
|
|
|
+ String case_id, String test_type, String description, String app_name, @PathVariable(required = false) String collaborative_type) {
|
|
|
try {
|
|
|
-
|
|
|
+ System.out.println("file " + file);
|
|
|
+ System.out.println("file_name " + file_name);
|
|
|
File dest = new File("/Users/guochao/Downloads/" + file_name);
|
|
|
if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
|
|
|
//从oss下载文件
|
|
@@ -314,7 +314,11 @@ public class ExtraController {
|
|
|
// 关闭资源
|
|
|
bin.close();
|
|
|
out.close();
|
|
|
- String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description);
|
|
|
+ if(collaborative_type == null || collaborative_type == ""){
|
|
|
+ collaborative_type = CollaborativeType.IS_COLLABORATIVE.getId() + "";
|
|
|
+ }
|
|
|
+ System.out.println(dest.getPath());
|
|
|
+ String json = extraService.saveExam(case_id, dest.getPath(), app_name, paper_type, test_type, description, collaborative_type);
|
|
|
return json;
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|