提交 e371f167 authored 作者: 任建彩's avatar 任建彩

feat:1.下载

1.file
上级 da236045
......@@ -354,7 +354,8 @@ public class FileController {
@ApiOperation(value = "下载全部资源zip包")
@RequestMapping(value = "/download/resourceZip", method = RequestMethod.GET)
public String downLoadResource(HttpServletResponse response,String zipPath,String fileName) throws Exception {
DownloadUtil.start(response, zipPath, fileName);
String name=zipPath.substring(zipPath.lastIndexOf("/")+1);
DownloadUtil.start(response, zipPath, name);
return null;
}
......@@ -721,6 +722,18 @@ public class FileController {
}
return null;
}
@ApiOperation("ZIP文件下载")
@GetMapping("/downloadZIP")
public String downloadZIP(HttpServletRequest request, HttpServletResponse response,String name) {
String fileName = "/opt/upload/wyszyk/"+name;
File file = new File(fileName);
try {
DownloadUtil.start(response, file, name);
} catch (Exception e) {
throw new FileBizException("文件下载失败!");
}
return null;
}
@ApiOperation(value = "文件上传 图片")
@RequestMapping(value = "/upload/img", method = RequestMethod.POST)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论