优化部分操作。
This commit is contained in:
parent
849f96cf20
commit
6a48585380
|
|
@ -1079,7 +1079,8 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
FileInfoVO fileInfoVO = BeanUtil.copyProperties(fileInfo, FileInfoVO.class);
|
FileInfoVO fileInfoVO = BeanUtil.copyProperties(fileInfo, FileInfoVO.class);
|
||||||
fileInfoVO.setFileSizeShow(EleCommonUtil.convertFileSize(fileInfoVO.getFileSize()));
|
fileInfoVO.setFileSizeShow(EleCommonUtil.convertFileSize(fileInfoVO.getFileSize()));
|
||||||
fileInfoVO.setLabels(fileTagRelationService.getFileTags(fileInfo.getFileId()));
|
fileInfoVO.setLabels(fileTagRelationService.getFileTags(fileInfo.getFileId()));
|
||||||
UserThreadLocal.setSuccessInfo(fileInfo.getParentId(), id, "查询了文件的详细信息");
|
String filePath = commonService.getDbPath(fileInfo.getFilePath());
|
||||||
|
UserThreadLocal.setSuccessInfo(fileInfo.getParentId(), id, "查询了文件的详细信息,文件id {},文件路径 {}", id, filePath);
|
||||||
return ElectromagneticResultUtil.success(fileInfoVO);
|
return ElectromagneticResultUtil.success(fileInfoVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1304,6 +1305,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
try {
|
try {
|
||||||
EdFileInfo fileInfo = this.baseMapper.selectById(id);
|
EdFileInfo fileInfo = this.baseMapper.selectById(id);
|
||||||
Assert.isTrue(Objects.nonNull(fileInfo), "文件不存在");
|
Assert.isTrue(Objects.nonNull(fileInfo), "文件不存在");
|
||||||
|
String fileDbPath = commonService.getDbPath(fileInfo.getFilePath());
|
||||||
String fileSysPath = commonService.getFileSysPath(fileInfo.getFilePath(), dataOwnCode);
|
String fileSysPath = commonService.getFileSysPath(fileInfo.getFilePath(), dataOwnCode);
|
||||||
String fileSaveTmpPath = elePropertyConfig.getEleTmpPath() + File.separator + IdUtil.fastSimpleUUID() + "." + fileInfo.getFileType();
|
String fileSaveTmpPath = elePropertyConfig.getEleTmpPath() + File.separator + IdUtil.fastSimpleUUID() + "." + fileInfo.getFileType();
|
||||||
FileUtil.copy(fileSysPath, fileSaveTmpPath, true);
|
FileUtil.copy(fileSysPath, fileSaveTmpPath, true);
|
||||||
|
|
@ -1332,7 +1334,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + fileName);
|
headers.add(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + fileName);
|
||||||
headers.add(HttpHeaders.CONTENT_TYPE, mimeType);
|
headers.add(HttpHeaders.CONTENT_TYPE, mimeType);
|
||||||
// 构建响应实体(可以返回<byte[]或Resource,返回类型取决body入参类型)
|
// 构建响应实体(可以返回<byte[]或Resource,返回类型取决body入参类型)
|
||||||
UserThreadLocal.setSuccessInfo(fileInfo.getParentId(), fileInfo.getFileId(), "文件预览成功,文件名为 {}", fileInfo.getFileName() + "." + fileInfo.getFileType());
|
UserThreadLocal.setSuccessInfo(fileInfo.getParentId(), fileInfo.getFileId(), "文件预览成功,文件名为 {},路径为 {}", fileInfo.getFileName() + "." + fileInfo.getFileType(), fileDbPath);
|
||||||
return ResponseEntity
|
return ResponseEntity
|
||||||
.ok()
|
.ok()
|
||||||
.headers(headers)
|
.headers(headers)
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ public class FileTagRelationServiceImpl extends ServiceImpl<FileTagRelationMappe
|
||||||
BeanUtils.copyProperties(tagInfo, vo);
|
BeanUtils.copyProperties(tagInfo, vo);
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
UserThreadLocal.setSuccessInfo("", "", "获取了标签数据");
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class UserAccessLogServiceImpl extends ServiceImpl<UserAccessLogMapper, U
|
||||||
OperationModuleVO vo = new OperationModuleVO().setText(e.desc).setValue(e.key);
|
OperationModuleVO vo = new OperationModuleVO().setText(e.desc).setValue(e.key);
|
||||||
res.add(vo);
|
res.add(vo);
|
||||||
}
|
}
|
||||||
|
UserThreadLocal.setSuccessInfo("", "", "查询所有操作对象成功");
|
||||||
return ElectromagneticResultUtil.success(res);
|
return ElectromagneticResultUtil.success(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue