增加文件中心配置

This commit is contained in:
wanggeng 2022-08-07 21:58:59 +08:00
parent c9383db7e5
commit aa85cae903
2 changed files with 69 additions and 23 deletions

View File

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

View File

@ -24,6 +24,7 @@ public class FileProperties {
private Double imageOutputQuality;
private Boolean useMinIo;
private FileMinIoProperties minIo;
private FileCenterProperties center;
public String getUploadPath() {
return uploadPath;
@ -105,28 +106,11 @@ public class FileProperties {
this.minIo = minIo;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("{");
sb.append("\"uploadPath\":\"")
.append(uploadPath).append('\"');
sb.append(",\"imageTypes\":\"")
.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();
public FileCenterProperties getCenter() {
return center;
}
public void setCenter(FileCenterProperties center) {
this.center = center;
}
}