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

feat:打包文件

1.resource
上级 2fc6f890
...@@ -115,7 +115,7 @@ public class GoodsLibraryController { ...@@ -115,7 +115,7 @@ public class GoodsLibraryController {
} }
@ApiOperation(value = "删除zip压缩文件") @ApiOperation(value = "删除zip压缩文件")
@PostMapping(value = "/deleteZip") @PostMapping(value = "/deleteZip")
public CallBack<Boolean> downLoadResource(@RequestBody String id) throws Exception { public CallBack<Boolean> downLoadResource(String id) throws Exception {
GoodsLibrary goodsLibrary = service.getById(id); GoodsLibrary goodsLibrary = service.getById(id);
if (goodsLibrary != null) { if (goodsLibrary != null) {
if (StringUtils.isNotBlank(goodsLibrary.getFileName())) { if (StringUtils.isNotBlank(goodsLibrary.getFileName())) {
...@@ -123,7 +123,7 @@ public class GoodsLibraryController { ...@@ -123,7 +123,7 @@ public class GoodsLibraryController {
File file = new File(goodsLibrary.getFileName()); File file = new File(goodsLibrary.getFileName());
if (file.exists() && file.isFile()) { if (file.exists() && file.isFile()) {
String[] cmd = new String[]{"/bin/sh", "-c", "rm -rf " + goodsLibrary.getFileName()}; String[] cmd = new String[]{"/bin/sh", "-c", "rm -rf " + goodsLibrary.getFileName()};
Process process = Runtime.getRuntime().exec(cmd); Runtime.getRuntime().exec(cmd);
goodsLibrary.setFileName(null); goodsLibrary.setFileName(null);
service.updateById(goodsLibrary); service.updateById(goodsLibrary);
}else{ }else{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论