From aa85cae90397717a0a62e065b3ae75ce85996d12 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Sun, 7 Aug 2022 21:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/FileCenterProperties.java | 62 +++++++++++++++++++ .../ink/wgink/properties/FileProperties.java | 30 +++------ 2 files changed, 69 insertions(+), 23 deletions(-) create mode 100644 basic-properties/src/main/java/ink/wgink/properties/FileCenterProperties.java diff --git a/basic-properties/src/main/java/ink/wgink/properties/FileCenterProperties.java b/basic-properties/src/main/java/ink/wgink/properties/FileCenterProperties.java new file mode 100644 index 00000000..ca250306 --- /dev/null +++ b/basic-properties/src/main/java/ink/wgink/properties/FileCenterProperties.java @@ -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; + } +} diff --git a/basic-properties/src/main/java/ink/wgink/properties/FileProperties.java b/basic-properties/src/main/java/ink/wgink/properties/FileProperties.java index b29ac640..e4d93c7e 100644 --- a/basic-properties/src/main/java/ink/wgink/properties/FileProperties.java +++ b/basic-properties/src/main/java/ink/wgink/properties/FileProperties.java @@ -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; } }