1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-22 01:30:40 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

完成文件对象管理刷新状态功能

This commit is contained in:
2022-04-16 23:47:22 +08:00
parent 3b6c6aa3e7
commit 5c895d0ef5
6 changed files with 134 additions and 39 deletions

View File

@@ -78,7 +78,7 @@ public class FileObjectServiceImpl implements FileObjectService {
}
private FileObjectModel convertFromDataObject(FileObjectDO fileObjectDO) throws InvocationTargetException, IllegalAccessException {
if(fileObjectDO == null) {
if (fileObjectDO == null) {
return null;
}
FileObjectModel fileObjectModel = new FileObjectModel();
@@ -103,7 +103,7 @@ public class FileObjectServiceImpl implements FileObjectService {
}
private FileObjectDO convertFromFileObjectModel(FileObjectModel fileObjectModel) {
if(fileObjectModel == null) {
if (fileObjectModel == null) {
return null;
}
FileObjectDO fileObjectDO = new FileObjectDO();
@@ -213,7 +213,7 @@ public class FileObjectServiceImpl implements FileObjectService {
}
/**
* 通过文件路径获取文件
* 通过文件路径获取文件对象
*
* @param filePath 文件路径
* @return
@@ -224,4 +224,19 @@ public class FileObjectServiceImpl implements FileObjectService {
FileObjectModel fileObjectModel = convertFromDataObject(fileObjectDO);
return fileObjectModel;
}
/**
* 通过 Id 获取文件对象
*
* @param fileObjectId 文件对象 Id
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@Override
public FileObjectModel getFileObjectById(Integer fileObjectId) throws InvocationTargetException, IllegalAccessException {
FileObjectDO fileObjectDO = fileObjectDOMapper.selectByPrimaryKey(fileObjectId);
FileObjectModel fileObjectModel = convertFromDataObject(fileObjectDO);
return fileObjectModel;
}
}