|
@ -1,6 +1,9 @@ |
|
|
package org.dromara.system.config; |
|
|
package org.dromara.system.config; |
|
|
|
|
|
|
|
|
import io.minio.MinioClient; |
|
|
import io.minio.MinioClient; |
|
|
|
|
|
import lombok.Getter; |
|
|
|
|
|
import lombok.Setter; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
import org.springframework.context.annotation.Bean; |
|
|
import org.springframework.context.annotation.Configuration; |
|
|
import org.springframework.context.annotation.Configuration; |
|
@ -12,51 +15,23 @@ import org.springframework.context.annotation.Configuration; |
|
|
*/ |
|
|
*/ |
|
|
@Configuration |
|
|
@Configuration |
|
|
@ConfigurationProperties(prefix = "osstianyi") |
|
|
@ConfigurationProperties(prefix = "osstianyi") |
|
|
|
|
|
@Getter |
|
|
|
|
|
@Setter |
|
|
public class OssTianyiConfig |
|
|
public class OssTianyiConfig |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
@Value("${osstianyi.endPoint:https://jiangsu-10.zos.ctyun.cn}") |
|
|
private String endPoint; |
|
|
private String endPoint; |
|
|
private String accessKey; |
|
|
|
|
|
private String secretKey; |
|
|
|
|
|
private String bucketName; |
|
|
|
|
|
|
|
|
|
|
|
public String getEndPoint() { |
|
|
|
|
|
return endPoint; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setEndPoint(String endPoint) { |
|
|
|
|
|
this.endPoint = endPoint; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getAccessKey() |
|
|
|
|
|
{ |
|
|
|
|
|
return accessKey; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setAccessKey(String accessKey) |
|
|
|
|
|
{ |
|
|
|
|
|
this.accessKey = accessKey; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getSecretKey() |
|
|
@Value("${osstianyi.accessKey:22e3f37368a242b38f4f25d98c9baf1f}") |
|
|
{ |
|
|
private String accessKey; |
|
|
return secretKey; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setSecretKey(String secretKey) |
|
|
@Value("${osstianyi.secretKey:0d858850666248e59830d9a596847062}") |
|
|
{ |
|
|
private String secretKey; |
|
|
this.secretKey = secretKey; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getBucketName() |
|
|
@Value("${osstianyi.bucketName:dkossbucket}") |
|
|
{ |
|
|
private String bucketName; |
|
|
return bucketName; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setBucketName(String bucketName) |
|
|
|
|
|
{ |
|
|
|
|
|
this.bucketName = bucketName; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public String toString() { |
|
|
public String toString() { |
|
@ -71,9 +46,6 @@ public class OssTianyiConfig |
|
|
@Bean |
|
|
@Bean |
|
|
public MinioClient getMinioClient() |
|
|
public MinioClient getMinioClient() |
|
|
{ |
|
|
{ |
|
|
// System.out.println("OssTianyiConfig");
|
|
|
|
|
|
// System.out.println("OssTianyiConfig" + endPoint);
|
|
|
|
|
|
System.out.println(toString()); |
|
|
|
|
|
return MinioClient.builder().endpoint(endPoint).credentials(accessKey, secretKey).build(); |
|
|
return MinioClient.builder().endpoint(endPoint).credentials(accessKey, secretKey).build(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|