mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🎨 抽取 S3 通用 API
This commit is contained in:
36
src/main/java/im/zhaojun/common/model/S3Model.java
Normal file
36
src/main/java/im/zhaojun/common/model/S3Model.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package im.zhaojun.common.model;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import im.zhaojun.common.util.StringUtils;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
* @date 2019/12/26 22:07
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
public class S3Model {
|
||||
|
||||
private String bucketName;
|
||||
|
||||
private String path;
|
||||
|
||||
private String basePath;
|
||||
|
||||
private String domain;
|
||||
|
||||
private long timeout;
|
||||
|
||||
/**
|
||||
* 获取 basePath + path 的全路径地址.
|
||||
* @return basePath + path 的全路径地址.
|
||||
*/
|
||||
public String getFullPath() {
|
||||
String basePath = ObjectUtil.defaultIfNull(this.basePath, "");
|
||||
String path = ObjectUtil.defaultIfNull(this.path, "");
|
||||
return StringUtils.removeDuplicateSeparator(basePath + "/" + path);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user