| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | @Autowired |
| | | private DownLoadFileService downLoadFileService; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | /** |
| | |
| | | * @param delete 是否删除 |
| | | */ |
| | | @GetMapping("/download") |
| | | public void fileDownload(@PathParam("fileName") String fileName,@PathParam("delete") Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | public void fileDownload(@PathParam("fileName") String fileName, @PathParam("delete") Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/downLoadFile") |
| | | public AjaxResult downLoadFile(@RequestParam("path") String path,HttpServletResponse response) throws Exception { |
| | | return 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 |
| | | { |