09-22-文件服务暴露删除方法

This commit is contained in:
2025-09-22 15:05:41 +08:00
parent 1e16cfd54e
commit 772b610bec
10 changed files with 724 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import org.dromara.resource.service.ISysOssService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.List;
/**
@ -86,4 +87,13 @@ public class RemoteFileServiceImpl implements RemoteFileService {
List<SysOssVo> sysOssVos = sysOssService.listByIds(StringUtils.splitTo(ossIds, Convert::toLong));
return MapstructUtils.convert(sysOssVos, RemoteFile.class);
}
@Override
public void deleteFile(Collection<String> urls){
OssClient storage = OssFactory.instance();
for (String url : urls) {
storage.delete(url);
}
}
}