文档库--编辑和删除时,关联删除文件

This commit is contained in:
zhn
2022-02-22 14:05:11 +08:00
parent eb75eb329a
commit bdb0a3a96f
3 changed files with 69 additions and 37 deletions
@@ -30,4 +30,7 @@ public interface IOSSFileService extends IService<OSSFile> {
*/
void updateFileInfo(List<OSSFile> ossFileList);
void deleteByConnectIdList(List<String> connectIdList);
}
@@ -145,4 +145,11 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
this.updateBatchById(ossFileList);
}
@Override
public void deleteByConnectIdList(List<String> connectIdList) {
LambdaQueryWrapper<OSSFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(OSSFile::getConnectId,connectIdList);
this.remove(lambdaQueryWrapper);
}
}