|
@@ -264,6 +264,59 @@ public class ExtraController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// @RequestMapping(value = "/uploadExamUrl", method = RequestMethod.POST)
|
|
|
+// @ResponseBody
|
|
|
+// public String uploadExamUrl1(String file, String file_name, String paper_type,
|
|
|
+// String case_id, String test_type, String description, String app_name,
|
|
|
+// String if_test_case,String if_bug) {
|
|
|
+// try {
|
|
|
+//
|
|
|
+// File dest = new File("/Users/hannatao/Downloads/" + file_name);
|
|
|
+// if(!dest.getParentFile().exists()) { dest.getParentFile().mkdirs(); }
|
|
|
+// //从oss下载文件
|
|
|
+// // 统一资源
|
|
|
+// URL url = new URL(file);
|
|
|
+// // 连接类的父类,抽象类
|
|
|
+// URLConnection urlConnection = url.openConnection();
|
|
|
+// // http的连接类
|
|
|
+// HttpURLConnection httpURLConnection = (HttpURLConnection) urlConnection;
|
|
|
+// //设置超时
|
|
|
+// httpURLConnection.setConnectTimeout(1000*5);
|
|
|
+// //设置请求方式,默认是GET
|
|
|
+//// httpURLConnection.setRequestMethod("GET");
|
|
|
+// // 设置字符编码
|
|
|
+// httpURLConnection.setRequestProperty("Charset", "UTF-8");
|
|
|
+// // 打开到此 URL引用的资源的通信链接(如果尚未建立这样的连接)。
|
|
|
+// httpURLConnection.connect();
|
|
|
+// // 文件大小
|
|
|
+// int fileLength = httpURLConnection.getContentLength();
|
|
|
+//
|
|
|
+// // 建立链接从请求中获取数据
|
|
|
+// URLConnection con = url.openConnection();
|
|
|
+// BufferedInputStream bin = new BufferedInputStream(httpURLConnection.getInputStream());
|
|
|
+// // 指定文件名称(有需求可以自定义)
|
|
|
+// // 指定存放位置(有需求可以自定义)
|
|
|
+//
|
|
|
+//
|
|
|
+// OutputStream out = new FileOutputStream(dest);
|
|
|
+// int size = 0;
|
|
|
+// int len = 0;
|
|
|
+// byte[] buf = new byte[2048];
|
|
|
+// while ((size = bin.read(buf)) != -1) {
|
|
|
+// len += size;
|
|
|
+// out.write(buf, 0, size);
|
|
|
+// }
|
|
|
+// // 关闭资源
|
|
|
+// bin.close();
|
|
|
+// out.close();
|
|
|
+// String json = extraService.saveExam1(case_id, dest.getPath(), app_name, paper_type, test_type, description,if_test_case,if_bug);
|
|
|
+// return json;
|
|
|
+// } catch (IOException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// return "";
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 47.99.140.117:9001/Bug/api/extra/getExamList
|
|
|
*
|
|
@@ -312,8 +365,11 @@ public class ExtraController {
|
|
|
@RequestMapping(value = "/uploadTestCase", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
public void uploadTestCase(String report_id, String name, String front, String behind,
|
|
|
- String description, HttpServletResponse response) {
|
|
|
+ String description,String if_execute,String if_bug, HttpServletResponse response) {
|
|
|
try {
|
|
|
+
|
|
|
+ System.out.println(if_execute);
|
|
|
+ System.out.println(if_bug);
|
|
|
String id = extraService.saveTestCase(report_id, name, front, behind, description);
|
|
|
PrintWriter out = response.getWriter();
|
|
|
JSONObject result = new JSONObject();
|