From 8ba9ddaeb71dcdf263f628d6ea2c59fd9b303ad7 Mon Sep 17 00:00:00 2001 From: Jinquan_Ou <Jinquan@gdut.com> Date: 星期日, 19 三月 2023 23:17:10 +0800 Subject: [PATCH] 4546 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index f424327..b68b6f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -6,11 +6,11 @@ import javax.servlet.http.HttpServletResponse; import javax.websocket.server.PathParam; +import com.ruoyi.service.DownLoadFileService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.security.core.parameters.P; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; @@ -34,6 +34,9 @@ @Autowired private ServerConfig serverConfig; + + @Autowired + private DownLoadFileService downLoadFileService; private static final String FILE_DELIMETER = ","; @@ -69,11 +72,17 @@ } } + @GetMapping("/downLoadFile") + public void downLoadFile(@PathParam("path") String path, HttpServletResponse response) throws Exception { + downLoadFileService.downLoadFile(path,response); + } + + /** * 閫氱敤涓婁紶璇锋眰锛堝崟涓級 */ @PostMapping("/upload") - public AjaxResult uploadFile(@RequestParam("uploadFile")MultipartFile file) throws Exception + public AjaxResult uploadFile(@RequestParam("uploadFile") MultipartFile file) throws Exception { try { -- Gitblit v1.9.1