From 5dde9397045366281cc42b8ace436379a5466c61 Mon Sep 17 00:00:00 2001 From: SZH <szh_hello@163.com> Date: 星期六, 20 八月 2022 13:02:44 +0800 Subject: [PATCH] 删除“系统执行错误”错误代码描述信息 删除冲突的minioConfig类 --- safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java | 5 + safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/config/MinioConfig.java | 180 ++++++++++++++++++++++---------------------- safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/service/MinioAccessService.java | 4 3 files changed, 96 insertions(+), 93 deletions(-) diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java index c06d0bd..56d1879 100644 --- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java +++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java @@ -110,6 +110,9 @@ public ResultVO errorHandler(Exception e) { e.printStackTrace(); logger.error(e.getMessage()); - return new ResultVO(ResultCodes.SERVER_ERROR); + ResultVO resultVO = new ResultVO<>(); + resultVO.setCode(ResultCodes.SERVER_ERROR.getCode()); + return resultVO; +// return new ResultVO(ResultCodes.SERVER_ERROR); } } diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/config/MinioConfig.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/config/MinioConfig.java index 25d2621..557b4da 100644 --- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/config/MinioConfig.java +++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/config/MinioConfig.java @@ -1,90 +1,90 @@ -package com.gkhy.safePlatform.minioFile.config; - -import io.minio.MinioClient; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -@Component -@ConfigurationProperties(prefix = "minio") -public class MinioConfig { - - private String endpoint; - - private int port; - - private String accessKey; - - private String secretKey; - - private Boolean secure; - - private String bucketName; - - private String urlPrefix; - - @Bean - public MinioClient getMinioClient(){ - String endpointUrl = "http://"+endpoint+":"+port; - MinioClient minioClient = MinioClient.builder().endpoint(endpointUrl) - .credentials(accessKey,secretKey) - .build(); - return minioClient; - } - - public String getEndpoint() { - return endpoint; - } - - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - - public Boolean getSecure() { - return secure; - } - - public void setSecure(Boolean secure) { - this.secure = secure; - } - - public String getBucketName() { - return bucketName; - } - - public void setBucketName(String bucketName) { - this.bucketName = bucketName; - } - - public String getUrlPrefix() { - return urlPrefix; - } - - public void setUrlPrefix(String urlPrefix) { - this.urlPrefix = urlPrefix; - } -} +//package com.gkhy.safePlatform.minioFile.config; +// +//import io.minio.MinioClient; +//import org.springframework.boot.context.properties.ConfigurationProperties; +//import org.springframework.context.annotation.Bean; +//import org.springframework.stereotype.Component; +// +//@Component +//@ConfigurationProperties(prefix = "minio") +//public class MinioConfig { +// +// private String endpoint; +// +// private int port; +// +// private String accessKey; +// +// private String secretKey; +// +// private Boolean secure; +// +// private String bucketName; +// +// private String urlPrefix; +// +// @Bean +// public MinioClient getMinioClient(){ +// String endpointUrl = "http://"+endpoint+":"+port; +// MinioClient minioClient = MinioClient.builder().endpoint(endpointUrl) +// .credentials(accessKey,secretKey) +// .build(); +// return minioClient; +// } +// +// public String getEndpoint() { +// return endpoint; +// } +// +// public void setEndpoint(String endpoint) { +// this.endpoint = endpoint; +// } +// +// public int getPort() { +// return port; +// } +// +// public void setPort(int port) { +// this.port = port; +// } +// +// public String getAccessKey() { +// return accessKey; +// } +// +// public void setAccessKey(String accessKey) { +// this.accessKey = accessKey; +// } +// +// public String getSecretKey() { +// return secretKey; +// } +// +// public void setSecretKey(String secretKey) { +// this.secretKey = secretKey; +// } +// +// public Boolean getSecure() { +// return secure; +// } +// +// public void setSecure(Boolean secure) { +// this.secure = secure; +// } +// +// public String getBucketName() { +// return bucketName; +// } +// +// public void setBucketName(String bucketName) { +// this.bucketName = bucketName; +// } +// +// public String getUrlPrefix() { +// return urlPrefix; +// } +// +// public void setUrlPrefix(String urlPrefix) { +// this.urlPrefix = urlPrefix; +// } +//} diff --git a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/service/MinioAccessService.java b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/service/MinioAccessService.java index e35c55b..c1e1095 100644 --- a/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/service/MinioAccessService.java +++ b/safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/minioFile/service/MinioAccessService.java @@ -1,6 +1,7 @@ package com.gkhy.safePlatform.minioFile.service; -import com.gkhy.safePlatform.minioFile.config.MinioConfig; +//import com.gkhy.safePlatform.minioFile.config.MinioConfig; +import com.gkhy.safePlatform.commons.config.file.MinioConfig; import com.gkhy.safePlatform.minioFile.utils.UUIDUtil; import io.minio.GetPresignedObjectUrlArgs; import io.minio.MinioClient; @@ -15,7 +16,6 @@ import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.Map; -import java.util.UUID; @Service public class MinioAccessService { -- Gitblit v1.9.2