统一命名规范,符合驼峰规则

This commit is contained in:
gaoxiongzaq
2023-12-19 08:55:51 +08:00
parent 13dfca016e
commit 0c6ea7248a
9 changed files with 55 additions and 55 deletions

View File

@ -41,8 +41,8 @@ public class CadFilePreviewImpl implements FilePreview {
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
String fileName = fileAttribute.getName();
String cadPreviewType = ConfigConstants.getCadPreviewType();
String cacheName = fileAttribute.getcacheName();
String outFilePath = fileAttribute.getoutFilePath();
String cacheName = fileAttribute.getCacheName();
String outFilePath = fileAttribute.getOutFilePath();
String fileKey = fileAttribute.getFileKey(); //判断是否压缩包
// 判断之前是否已转换过,如果转换过,直接返回,否则执行转换
if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(cacheName) || !ConfigConstants.isCacheEnabled()) {

View File

@ -36,12 +36,12 @@ public class MediaFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileName = fileAttribute.getName();
String suffix = fileAttribute.getSuffix();
String cacheName = fileAttribute.getcacheName();
String outFilePath = fileAttribute.getoutFilePath();
String cacheName = fileAttribute.getCacheName();
String outFilePath = fileAttribute.getOutFilePath();
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
String fileKey = fileAttribute.getFileKey();
FileType type = fileAttribute.getType();
String[] mediaTypesConvert = FileType.MEDIACONVERT_TYPES_CONVERT; //获取支持的转换格式
String[] mediaTypesConvert = FileType.MEDIA_CONVERT_TYPES; //获取支持的转换格式
boolean mediaTypes = false;
for(String temp : mediaTypesConvert){
if (suffix.equals(temp)) {

View File

@ -46,15 +46,15 @@ public class OfficeFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
// 预览Type参数传了就取参数的没传取系统默认
String officePreviewType = fileAttribute.getOfficePreviewType();
boolean userToken = fileAttribute.getUserToken();
boolean userToken = fileAttribute.getUsePasswordCache();
String baseUrl = BaseUrlFilter.getBaseUrl();
String suffix = fileAttribute.getSuffix(); //获取文件后缀
String fileName = fileAttribute.getName(); //获取文件原始名称
String filePassword = fileAttribute.getFilePassword(); //获取密码
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache(); //是否启用强制更新命令
boolean isHtml =fileAttribute.getisHtml(); //xlsx 转换成html
String cacheName = fileAttribute.getcacheName(); //转换后的文件名
String outFilePath = fileAttribute.getoutFilePath(); //转换后生成文件的路径
boolean isHtml =fileAttribute.getIsHtml(); //xlsx 转换成html
String cacheName = fileAttribute.getCacheName(); //转换后的文件名
String outFilePath = fileAttribute.getOutFilePath(); //转换后生成文件的路径
String fileKey = fileAttribute.getFileKey(); //判断是否压缩包
if (!officePreviewType.equalsIgnoreCase("html")) {
if (ConfigConstants.getOfficeTypeWeb() .equalsIgnoreCase("web")) {

View File

@ -34,8 +34,8 @@ public class PdfFilePreviewImpl implements FilePreview {
String pdfName = fileAttribute.getName(); //获取原始文件名
String officePreviewType = fileAttribute.getOfficePreviewType(); //转换类型
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache(); //是否启用强制更新命令
String outFilePath = fileAttribute.getoutFilePath(); //生成的文件路径
String fileNameFilePath = fileAttribute.getfileNameFilePath(); //原始文件路径
String outFilePath = fileAttribute.getOutFilePath(); //生成的文件路径
String originFilePath = fileAttribute.getOriginFilePath(); //原始文件路径
if (OfficeFilePreviewImpl.OFFICE_PREVIEW_TYPE_IMAGE.equals(officePreviewType) || OfficeFilePreviewImpl.OFFICE_PREVIEW_TYPE_ALL_IMAGES.equals(officePreviewType)) {
//当文件不存在时,就去下载
if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(pdfName) || !ConfigConstants.isCacheEnabled()) {
@ -43,15 +43,15 @@ public class PdfFilePreviewImpl implements FilePreview {
if (response.isFailure()) {
return otherFilePreview.notSupportedFile(model, fileAttribute, response.getMsg());
}
fileNameFilePath = response.getContent();
originFilePath = response.getContent();
if (ConfigConstants.isCacheEnabled()) {
// 加入缓存
fileHandlerService.addConvertedFile(pdfName, fileHandlerService.getRelativePath(fileNameFilePath));
fileHandlerService.addConvertedFile(pdfName, fileHandlerService.getRelativePath(originFilePath));
}
}
List<String> imageUrls;
try {
imageUrls = fileHandlerService.pdf2jpg(fileNameFilePath,outFilePath, pdfName, fileAttribute);
imageUrls = fileHandlerService.pdf2jpg(originFilePath,outFilePath, pdfName, fileAttribute);
} catch (Exception e) {
Throwable[] throwableArray = ExceptionUtils.getThrowables(e);
for (Throwable throwable : throwableArray) {

View File

@ -35,7 +35,7 @@ public class SimTextFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileName = fileAttribute.getName();
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
String filePath = fileAttribute.getfileNameFilePath();
String filePath = fileAttribute.getOriginFilePath();
if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(fileName) || !ConfigConstants.isCacheEnabled()) {
ReturnResponse<String> response = DownloadUtils.downLoad(fileAttribute, fileName);
if (response.isFailure()) {

View File

@ -34,8 +34,8 @@ public class TiffFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileName = fileAttribute.getName();
String tifPreviewType = ConfigConstants.getTifPreviewType();
String cacheName = fileAttribute.getcacheName();
String outFilePath = fileAttribute.getoutFilePath();
String cacheName = fileAttribute.getCacheName();
String outFilePath = fileAttribute.getOutFilePath();
String fileKey = fileAttribute.getFileKey(); //判断是否压缩包
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
if ("jpg".equalsIgnoreCase(tifPreviewType) || "pdf".equalsIgnoreCase(tifPreviewType)) {