From bf4364a3b6fd517a6c08e846fb0d4a6917e93d13 Mon Sep 17 00:00:00 2001 From: Shikong <919411476@qq.com> Date: Wed, 29 Mar 2023 21:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8D=95=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{SeaweedfsConfig.java => SeaweedFsConfig.java} | 4 +--- .../springcloud/project01/ApplicationTest.java | 14 ++++---------- 2 files changed, 5 insertions(+), 13 deletions(-) rename project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/{SeaweedfsConfig.java => SeaweedFsConfig.java} (68%) diff --git a/project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedfsConfig.java b/project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedFsConfig.java similarity index 68% rename from project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedfsConfig.java rename to project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedFsConfig.java index 60eee97..242e322 100644 --- a/project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedfsConfig.java +++ b/project-01/consumer/src/main/java/cn/skcks/study/springcloud/project01/config/SeaweedFsConfig.java @@ -2,14 +2,12 @@ package cn.skcks.study.springcloud.project01.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; @Data @Configuration @ConfigurationProperties(prefix = "seaweedfs") -public class SeaweedfsConfig { +public class SeaweedFsConfig { private String url; private String accessKey; private String secretKey; diff --git a/project-01/consumer/src/test/java/cn/skcks/study/springcloud/project01/ApplicationTest.java b/project-01/consumer/src/test/java/cn/skcks/study/springcloud/project01/ApplicationTest.java index b5b9953..041eda1 100644 --- a/project-01/consumer/src/test/java/cn/skcks/study/springcloud/project01/ApplicationTest.java +++ b/project-01/consumer/src/test/java/cn/skcks/study/springcloud/project01/ApplicationTest.java @@ -1,14 +1,11 @@ package cn.skcks.study.springcloud.project01; -import cn.skcks.study.springcloud.project01.config.SeaweedfsConfig; +import cn.skcks.study.springcloud.project01.config.SeaweedFsConfig; import io.minio.BucketExistsArgs; import io.minio.MakeBucketArgs; import io.minio.MinioClient; import io.minio.PutObjectArgs; -import io.minio.errors.*; import io.minio.messages.Bucket; -import lombok.NoArgsConstructor; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -18,13 +15,10 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit.jupiter.SpringExtension; import java.io.BufferedInputStream; -import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; @@ -36,13 +30,13 @@ public class ApplicationTest { public static void main(String[] args) { SpringApplication.run(ApplicationTest.class,args); } - private SeaweedfsConfig seaweedfsConfig; + private SeaweedFsConfig seaweedFsConfig; private MinioClient mc; private final static String bucket = "simple-test"; @Autowired - public void setSeaweedfsConfig(SeaweedfsConfig seaweedfsConfig) { - this.seaweedfsConfig = seaweedfsConfig; + public void setSeaweedFsConfig(SeaweedFsConfig seaweedfsConfig) { + this.seaweedFsConfig = seaweedfsConfig; log.info("{}",seaweedfsConfig); this.mc = MinioClient.builder() .endpoint(seaweedfsConfig.getUrl())