mirror of
https://gitee.com/shikong-sk/springcloud-study
synced 2024-11-12 19:41:17 +08:00
简单测试
This commit is contained in:
parent
54a6ece1f1
commit
bf4364a3b6
@ -2,14 +2,12 @@ package cn.skcks.study.springcloud.project01.config;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
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.Configuration;
|
||||||
import org.springframework.context.annotation.PropertySource;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConfigurationProperties(prefix = "seaweedfs")
|
@ConfigurationProperties(prefix = "seaweedfs")
|
||||||
public class SeaweedfsConfig {
|
public class SeaweedFsConfig {
|
||||||
private String url;
|
private String url;
|
||||||
private String accessKey;
|
private String accessKey;
|
||||||
private String secretKey;
|
private String secretKey;
|
@ -1,14 +1,11 @@
|
|||||||
package cn.skcks.study.springcloud.project01;
|
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.BucketExistsArgs;
|
||||||
import io.minio.MakeBucketArgs;
|
import io.minio.MakeBucketArgs;
|
||||||
import io.minio.MinioClient;
|
import io.minio.MinioClient;
|
||||||
import io.minio.PutObjectArgs;
|
import io.minio.PutObjectArgs;
|
||||||
import io.minio.errors.*;
|
|
||||||
import io.minio.messages.Bucket;
|
import io.minio.messages.Bucket;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
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 org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
@ -36,13 +30,13 @@ public class ApplicationTest {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(ApplicationTest.class,args);
|
SpringApplication.run(ApplicationTest.class,args);
|
||||||
}
|
}
|
||||||
private SeaweedfsConfig seaweedfsConfig;
|
private SeaweedFsConfig seaweedFsConfig;
|
||||||
private MinioClient mc;
|
private MinioClient mc;
|
||||||
private final static String bucket = "simple-test";
|
private final static String bucket = "simple-test";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setSeaweedfsConfig(SeaweedfsConfig seaweedfsConfig) {
|
public void setSeaweedFsConfig(SeaweedFsConfig seaweedfsConfig) {
|
||||||
this.seaweedfsConfig = seaweedfsConfig;
|
this.seaweedFsConfig = seaweedfsConfig;
|
||||||
log.info("{}",seaweedfsConfig);
|
log.info("{}",seaweedfsConfig);
|
||||||
this.mc = MinioClient.builder()
|
this.mc = MinioClient.builder()
|
||||||
.endpoint(seaweedfsConfig.getUrl())
|
.endpoint(seaweedfsConfig.getUrl())
|
||||||
|
Loading…
Reference in New Issue
Block a user