Skip to content

Commit

Permalink
chore: 查询文件列表增加存储名称信息返回
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 23, 2024
1 parent 8854f20 commit 69bc1e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,20 @@ public class FileResp extends BaseDetailResp {
private Long thumbnailSize;

/**
* 缩略图URL
* 缩略图 URL
*/
@Schema(description = "缩略图URL", example = "https://examplebucket.oss-cn-hangzhou.aliyuncs.com/example/example.jpg.min.jpg")
@Schema(description = "缩略图 URL", example = "https://examplebucket.oss-cn-hangzhou.aliyuncs.com/example/example.jpg.min.jpg")
private String thumbnailUrl;

/**
* 存储 ID
*/
@Schema(description = "存储ID", example = "1")
@Schema(description = "存储 ID", example = "1")
private Long storageId;

/**
* 存储名称
*/
@Schema(description = "存储名称", example = "MinIO")
private String storageName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ protected void fill(Object obj) {
String thumbnailUrl = StrUtils.blankToDefault(fileResp.getThumbnailUrl(), url, thUrl -> URLUtil
.normalize(prefix + thUrl));
fileResp.setThumbnailUrl(thumbnailUrl);
fileResp.setStorageName("%s (%s)".formatted(storage.getName(), storage.getCode()));
}
}
}

0 comments on commit 69bc1e5

Please sign in to comment.