附件
build / build-push (push) Successful in 52s

This commit is contained in:
wanghu
2026-09-21 17:25:25 +08:00
parent e15e272111
commit e93149b534
2 changed files with 19 additions and 0 deletions
@@ -82,6 +82,15 @@ public interface IFileService {
*/
void downloadZipByTopic(String topicType, Integer topicId, String zipName, HttpServletResponse response);
/**
* 按附件记录ID列表打包下载为 ZIP。
*
* @param fileIds 附件记录ID列表
* @param zipName 压缩包显示名(自动追加 .zip)
* @param response HTTP 响应
*/
void downloadZipByIds(List<Integer> fileIds, String zipName, HttpServletResponse response);
/**
* 批量上传图片(循环上传,返回每个文件的视图对象列表)。
*/
@@ -268,6 +268,16 @@ public class FileService implements IFileService {
downloadZip(files, zipName, response);
}
// ============================ 按附件ID列表打包下载 ============================
@Override
public void downloadZipByIds(List<Integer> fileIds, String zipName, HttpServletResponse response) {
List<UpFile> files = fileIds == null || fileIds.isEmpty()
? Collections.emptyList()
: upFileRepository.findAllById(fileIds);
downloadZip(files, zipName, response);
}
// ============================ 批量上传图片 ============================
@Override