【8.1.5】【file】文件列表信息增加文件大小的返回

dev-8.1.9
fengshuonan 2024-04-10 00:27:03 +08:00
parent 863604986c
commit 8373a5766f
2 changed files with 9 additions and 1 deletions

View File

@ -46,4 +46,11 @@ public class AntdvFileInfo {
*/ */
private String thumbUrl; private String thumbUrl;
/**
* xx kb, xx mb
* <p>
* 2024410
*/
private String sizeInfo;
} }

View File

@ -576,12 +576,13 @@ public class SysFileInfoServiceImpl extends ServiceImpl<SysFileInfoMapper, SysFi
// 设置文件名称 // 设置文件名称
LambdaQueryWrapper<SysFileInfo> sysFileInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysFileInfo> sysFileInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysFileInfoLambdaQueryWrapper.eq(SysFileInfo::getFileId, fileId); sysFileInfoLambdaQueryWrapper.eq(SysFileInfo::getFileId, fileId);
sysFileInfoLambdaQueryWrapper.select(SysFileInfo::getFileOriginName); sysFileInfoLambdaQueryWrapper.select(SysFileInfo::getFileOriginName, SysFileInfo::getFileSizeInfo);
SysFileInfo sysFileInfo = this.getOne(sysFileInfoLambdaQueryWrapper); SysFileInfo sysFileInfo = this.getOne(sysFileInfoLambdaQueryWrapper);
if (sysFileInfo == null) { if (sysFileInfo == null) {
continue; continue;
} }
antdvFileInfo.setName(sysFileInfo.getFileOriginName()); antdvFileInfo.setName(sysFileInfo.getFileOriginName());
antdvFileInfo.setSizeInfo(sysFileInfo.getFileSizeInfo());
// 设置文件的访问url // 设置文件的访问url
String fileAuthUrl = this.getFileAuthUrl(fileId); String fileAuthUrl = this.getFileAuthUrl(fileId);