add(req-2080):上传文件到华为云--代码优化
This commit is contained in:
parent
86fc1c7724
commit
1cc434a09c
@ -39,8 +39,10 @@ public class HuaWeiCloudObsClient implements OssClientBase {
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
@Override
|
@Override
|
||||||
public void initClient() {
|
public void initClient() {
|
||||||
log.info("initClient endpoint = {}, accessKeyId = {},secretAccessKey = {}", huaWeiCloudObsConfig.getEndPoint(),
|
log.info("accessKeyId = {},secretAccessKey = {}, initClient endpoint = {}",
|
||||||
huaWeiCloudObsConfig.getAccessKeyId(), huaWeiCloudObsConfig.getSecretAccessKey());
|
huaWeiCloudObsConfig.getAccessKeyId(),
|
||||||
|
huaWeiCloudObsConfig.getSecretAccessKey(),
|
||||||
|
huaWeiCloudObsConfig.getEndPoint());
|
||||||
try {
|
try {
|
||||||
instance = new ObsClient(
|
instance = new ObsClient(
|
||||||
huaWeiCloudObsConfig.getAccessKeyId(),
|
huaWeiCloudObsConfig.getAccessKeyId(),
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package cn.axzo.oss.integration.s3.config;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 华为云对象存储服务OBS配置
|
* 华为云对象存储服务OBS配置
|
||||||
@ -11,8 +11,8 @@ import org.springframework.stereotype.Component;
|
|||||||
* @author hucf
|
* @author hucf
|
||||||
* @since 2024/1/12 15:11
|
* @since 2024/1/12 15:11
|
||||||
**/
|
**/
|
||||||
|
@Configuration
|
||||||
@RefreshScope
|
@RefreshScope
|
||||||
@Component
|
|
||||||
@Data
|
@Data
|
||||||
public class HuaWeiCloudObsConfig {
|
public class HuaWeiCloudObsConfig {
|
||||||
@Value("${huaweicloud.obs.accessKeyId}")
|
@Value("${huaweicloud.obs.accessKeyId}")
|
||||||
@ -21,9 +21,6 @@ public class HuaWeiCloudObsConfig {
|
|||||||
@Value("${huaweicloud.obs.secretAccessKey}")
|
@Value("${huaweicloud.obs.secretAccessKey}")
|
||||||
private String secretAccessKey;
|
private String secretAccessKey;
|
||||||
|
|
||||||
@Value("${huaweicloud.obs.secretAccessKey}")
|
@Value("${huaweicloud.obs.endpoint}")
|
||||||
private String endPoint;
|
private String endPoint;
|
||||||
|
|
||||||
@Value("${huaweicloud.obs.bucket}")
|
|
||||||
private String bucket;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user