Skip to content

Commit

Permalink
fix: 转换为 X-File-Storage 文件信息对象时未设置缩略图 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
luoqiz authored Jun 13, 2024
1 parent 5abdb8d commit f250c70
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class FileDO extends BaseDO {
/**
* 缩略图URL
*/
private String thumbnailUrl;
private String thumbnailUrl; 

/**
* 存储 ID
Expand All @@ -91,15 +91,16 @@ public FileInfo toFileInfo(String storageCode) {
FileInfo fileInfo = new FileInfo();
fileInfo.setOriginalFilename(StrUtils
.blankToDefault(this.extension, this.name, ex -> this.name + StringConstants.DOT + ex));
fileInfo.setSize(this.size);
fileInfo.setSize(this.size); 
fileInfo.setUrl(this.url);
fileInfo.setExt(this.extension);
fileInfo.setBasePath(StringConstants.EMPTY);
fileInfo.setPath(StringConstants.EMPTY);
fileInfo.setFilename(URLUtils.isHttpUrl(this.url)
? StrUtil.subAfter(this.url, StringConstants.SLASH, true)
fileInfo.setFilename(URLUtils.isHttpUrl(this.url) 
? StrUtil.subAfter(this.url, StringConstants.SLASH, true) 
: this.url);
fileInfo.setPlatform(storageCode);
fileInfo.setThFilename(this.thumbnailUrl);  
fileInfo.setPlatform(storageCode); 
return fileInfo;
}
}
}

0 comments on commit f250c70

Please sign in to comment.