增加文件中心配置
This commit is contained in:
parent
c9383db7e5
commit
aa85cae903
@ -0,0 +1,62 @@
|
|||||||
|
package ink.wgink.properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: FileCenterProperties
|
||||||
|
* @Description: 文件中心
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2022/8/5 20:33
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class FileCenterProperties {
|
||||||
|
|
||||||
|
private String uploadUrl;
|
||||||
|
private String showUrl;
|
||||||
|
private String accessKey;
|
||||||
|
private String accessSecret;
|
||||||
|
|
||||||
|
public String getUploadUrl() {
|
||||||
|
if (uploadUrl == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
uploadUrl = uploadUrl.trim();
|
||||||
|
if (uploadUrl.endsWith("/")) {
|
||||||
|
uploadUrl = uploadUrl.substring(0, uploadUrl.length() - 1);
|
||||||
|
}
|
||||||
|
return uploadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUploadUrl(String uploadUrl) {
|
||||||
|
this.uploadUrl = uploadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShowUrl() {
|
||||||
|
if (showUrl == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
showUrl = showUrl.trim();
|
||||||
|
if (showUrl.endsWith("/")) {
|
||||||
|
showUrl = showUrl.substring(0, showUrl.length() - 1);
|
||||||
|
}
|
||||||
|
return showUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowUrl(String showUrl) {
|
||||||
|
this.showUrl = showUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccessKey() {
|
||||||
|
return accessKey == null ? "" : accessKey.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessKey(String accessKey) {
|
||||||
|
this.accessKey = accessKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccessSecret() {
|
||||||
|
return accessSecret == null ? "" : accessSecret.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessSecret(String accessSecret) {
|
||||||
|
this.accessSecret = accessSecret;
|
||||||
|
}
|
||||||
|
}
|
@ -24,6 +24,7 @@ public class FileProperties {
|
|||||||
private Double imageOutputQuality;
|
private Double imageOutputQuality;
|
||||||
private Boolean useMinIo;
|
private Boolean useMinIo;
|
||||||
private FileMinIoProperties minIo;
|
private FileMinIoProperties minIo;
|
||||||
|
private FileCenterProperties center;
|
||||||
|
|
||||||
public String getUploadPath() {
|
public String getUploadPath() {
|
||||||
return uploadPath;
|
return uploadPath;
|
||||||
@ -105,28 +106,11 @@ public class FileProperties {
|
|||||||
this.minIo = minIo;
|
this.minIo = minIo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public FileCenterProperties getCenter() {
|
||||||
public String toString() {
|
return center;
|
||||||
final StringBuilder sb = new StringBuilder("{");
|
}
|
||||||
sb.append("\"uploadPath\":\"")
|
|
||||||
.append(uploadPath).append('\"');
|
public void setCenter(FileCenterProperties center) {
|
||||||
sb.append(",\"imageTypes\":\"")
|
this.center = center;
|
||||||
.append(imageTypes).append('\"');
|
|
||||||
sb.append(",\"videoTypes\":\"")
|
|
||||||
.append(videoTypes).append('\"');
|
|
||||||
sb.append(",\"audioTypes\":\"")
|
|
||||||
.append(audioTypes).append('\"');
|
|
||||||
sb.append(",\"fileTypes\":\"")
|
|
||||||
.append(fileTypes).append('\"');
|
|
||||||
sb.append(",\"maxFileCount\":")
|
|
||||||
.append(maxFileCount);
|
|
||||||
sb.append(",\"imageOutputQuality\":")
|
|
||||||
.append(imageOutputQuality);
|
|
||||||
sb.append(",\"useMinIo\":")
|
|
||||||
.append(useMinIo);
|
|
||||||
sb.append(",\"minIo\":")
|
|
||||||
.append(minIo);
|
|
||||||
sb.append('}');
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user