mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-10-10 09:45:14 +08:00
通过书本ID获取所有文件对象信息;前端书籍详情页面直链下载功能完成;后端COS部分功能完善;下载文件设置"Content-Disposition"为"attachment; filename="
This commit is contained in:
@@ -36,6 +36,25 @@ public class FileObjectServiceImpl implements FileObjectService {
|
||||
@Autowired
|
||||
FileServiceImpl fileService;
|
||||
|
||||
/**
|
||||
* 通过书本Id获取关联文件,进而获取所有关联文件对应的文件对象
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FileObjectModel> getFileObjectByBookId(Integer bookId) throws InvocationTargetException, IllegalAccessException {
|
||||
|
||||
FileObjectDO[] fileObjectDOS = fileObjectDOMapper.selectFileObjectByBookId(bookId);
|
||||
|
||||
List<FileObjectModel> fileObjectModels = new ArrayList<>();
|
||||
for (FileObjectDO fileObjectDO : fileObjectDOS) {
|
||||
FileObjectModel fileObjectModel = convertFromDataObject(fileObjectDO);
|
||||
fileObjectModels.add(fileObjectModel);
|
||||
}
|
||||
|
||||
return fileObjectModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出所有文件对象
|
||||
*
|
||||
|
@@ -10,6 +10,16 @@ import java.util.List;
|
||||
|
||||
public interface FileObjectService {
|
||||
|
||||
/**
|
||||
* 通过书本Id获取关联文件,进而获取所有关联文件对应的文件对象
|
||||
*
|
||||
* @param bookId
|
||||
* @return
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
List<FileObjectModel> getFileObjectByBookId(Integer bookId) throws InvocationTargetException, IllegalAccessException;
|
||||
|
||||
/**
|
||||
* 列出所有文件对象
|
||||
*
|
||||
|
Reference in New Issue
Block a user