@@ -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
|
||||
|
||||
Reference in New Issue
Block a user