feat(req-2080):不同环境路径配置自动化

This commit is contained in:
胡朝飞 2024-01-22 16:55:46 +08:00
parent 0dbe8e3b5e
commit 6151b89200
2 changed files with 9 additions and 3 deletions

View File

@ -56,4 +56,10 @@ public class HuaWeiCloudObsConfig {
*/
@Value("${huaweicloud.checkpoint.encode-headers}")
private String encodeHeaders;
/**
* 是否开启请求头域自动编码
*/
@Value("${huaweicloud.profiles.active}")
private String profilesActive;
}

View File

@ -48,7 +48,7 @@ public class HuaWeiCloudServiceImpl implements HuaWeiCloudService {
ObsClient obsClient = huaWeiCloudObsClient.getClient();
// 创建文件夹
String objectKey = appCode + "/" + fileName;
String objectKey = huaWeiCloudObsConfig.getProfilesActive() + "/" + appCode + "/" + fileName;
try {
if (APPCODE_CMS.equals(appCode)) {
// 普通上传方式
@ -91,7 +91,7 @@ public class HuaWeiCloudServiceImpl implements HuaWeiCloudService {
ObsClient obsClient = huaWeiCloudObsClient.getClient();
// 创建文件夹
String objectKey = appCode + "/" + fileName;
String objectKey = huaWeiCloudObsConfig.getProfilesActive() + "/" + appCode + "/" + fileName;
try {
if (APPCODE_CMS.equals(appCode)) {
// 断点续传
@ -138,7 +138,7 @@ public class HuaWeiCloudServiceImpl implements HuaWeiCloudService {
ObsClient obsClient = huaWeiCloudObsClient.getClient();
// 创建文件夹
String objectKey = appCode + "/" + fileName;
String objectKey = huaWeiCloudObsConfig.getProfilesActive() + "/" + appCode + "/" + fileName;
try {
// 初始化分段上传任务