Commit d0e3f73b by 翁国栋

删除用户下的所有文件

parent e7243de1
...@@ -392,4 +392,40 @@ public class DiskCatalogueController { ...@@ -392,4 +392,40 @@ public class DiskCatalogueController {
map.put("breadcrumbData",breadcrumbDataList); map.put("breadcrumbData",breadcrumbDataList);
return ResultUtil.data(map); return ResultUtil.data(map);
} }
@GetMapping(value = "/deleteAlLFile")
@ApiOperation(value = "删除用户下的所有文件夹", httpMethod = "GET", notes = "文件夹或共享空间:type=0共享空间,1文件夹")
@ApiOperationSupport(order = 2)
private Result<Object> deleteAlLFile(@CurrentUser UserBean userBean, DiskCatalogueParam diskCatalogueParam){
List<DiskCatalogue> diskCatalogueList = DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>().lambda()
.eq(DiskCatalogue::getCreateUserId,diskCatalogueParam.getUserId())
.eq(DiskCatalogue::getParentId,0)
.eq(DiskCatalogue::getDeleteFlag,0));
if (diskCatalogueList.size()<=0){
return ResultUtil.error("该用户下没有文件");
}
/*查找ids第一个*/
diskCatalogueList.forEach(d->{
// List<DiskCatalogue> subFileList =DiskCatalogue.builder().build().selectList(new QueryWrapper<DiskCatalogue>().lambda()
// .like(DiskCatalogue::getParentIds,d.getId())
// .eq(DiskCatalogue::getDeleteFlag,0));
// List<DiskCatalogue> subFileList =diskCatalogueService.getSubCatalogueList(d.getId().toString(),diskCatalogueParam.getUserId());
// subFileList.forEach(s->{
// List<DiskCatalogueFiles> diskCatalogueFilesList = DiskCatalogueFiles.builder().build().selectList(new QueryWrapper<DiskCatalogueFiles>().lambda()
// .eq(DiskCatalogueFiles::getCatalogueId,s.getId())
// .eq(DiskCatalogueFiles::getDeleteFlag,0));
// diskCatalogueFilesList.forEach(f->{
// DiskFiles.builder().deleteFlag(1).build().update(new QueryWrapper<DiskFiles>().lambda().eq(DiskFiles::getId,f.getFilesId()));
// });
// s.setDeleteFlag(1);
// s.updateById();
// });
d.setDeleteFlag(1);
d.updateById();
});
return ResultUtil.success();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment