瀏覽代碼

上传资源打印日志

dengsixing 2 年之前
父節點
當前提交
ef0fd02620
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13 0
      src/main/java/com/fdkankan/contro/controller/SceneFileController.java

+ 13 - 0
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -78,4 +78,17 @@ public class SceneFileController{
                          String params) throws Exception {
         return sceneFileBuildService.uploadFile(file, params);
     }
+
+    /**
+     * 单个文件上传
+     * @param file
+     * @param params
+     * @return
+     */
+    @PostMapping("testUpload")
+    public ResultData testUpload(@RequestParam(value = "file",required = false) MultipartFile file,
+        String params) throws Exception {
+        file.transferTo(new File("/home/backend/tomcat/modeling-control/logs/" + file.getOriginalFilename()));
+        return ResultData.ok();
+    }
 }