chore: 查询文件列表增加存储名称信息返回

This commit is contained in:
2024-05-23 21:53:14 +08:00
parent 8854f20ce9
commit 69bc1e52e1
2 changed files with 10 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -154,6 +154,7 @@ public class FileServiceImpl extends BaseServiceImpl<FileMapper, FileDO, FileRes
String thumbnailUrl = StrUtils.blankToDefault(fileResp.getThumbnailUrl(), url, thUrl -> URLUtil
.normalize(prefix + thUrl));
fileResp.setThumbnailUrl(thumbnailUrl);
fileResp.setStorageName("%s (%s)".formatted(storage.getName(), storage.getCode()));
}
}
}