feat:(REQ-3540) 文件复制接口与阿里云/华为云对接日志添加
This commit is contained in:
parent
503826f5ca
commit
a4c336b4cb
@ -7,6 +7,7 @@ import cn.axzo.oss.integration.s3.AliOssService;
|
|||||||
import cn.axzo.oss.integration.s3.client.AliOssAppProClient;
|
import cn.axzo.oss.integration.s3.client.AliOssAppProClient;
|
||||||
import cn.axzo.oss.integration.s3.client.AliOssClient;
|
import cn.axzo.oss.integration.s3.client.AliOssClient;
|
||||||
import cn.azxo.framework.common.utils.LogUtil;
|
import cn.azxo.framework.common.utils.LogUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.aliyun.oss.HttpMethod;
|
import com.aliyun.oss.HttpMethod;
|
||||||
import com.aliyun.oss.OSS;
|
import com.aliyun.oss.OSS;
|
||||||
import com.aliyun.oss.OSSException;
|
import com.aliyun.oss.OSSException;
|
||||||
@ -423,7 +424,10 @@ public class AliOssServiceImpl implements AliOssService {
|
|||||||
@Override
|
@Override
|
||||||
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
|
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
|
||||||
try {
|
try {
|
||||||
return aliOssClient.getClient().copyObject(bucketName, key, targetBucketName, targetKey);
|
log.info("aliOssService#copyObject,params bucketName:{}, key:{}, targetBucketName:{}, targetKey:{}", bucketName, key, targetBucketName, targetKey);
|
||||||
|
CopyObjectResult copyObjectResult = aliOssClient.getClient().copyObject(bucketName, key, targetBucketName, targetKey);
|
||||||
|
log.info("aliOssService#copyObject,bucketName:{}, key:{},result:{}", bucketName, key, JSON.toJSONString(copyObjectResult));
|
||||||
|
return copyObjectResult;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("aliyun-copyObject-exception, bucketName:{}, key:{}", bucketName, key, e);
|
log.warn("aliyun-copyObject-exception, bucketName:{}, key:{}", bucketName, key, e);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import cn.axzo.oss.integration.s3.config.HuaWeiCloudObsConfig;
|
|||||||
import cn.azxo.framework.common.utils.LogUtil;
|
import cn.azxo.framework.common.utils.LogUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.obs.services.ObsClient;
|
import com.obs.services.ObsClient;
|
||||||
import com.obs.services.exception.ObsException;
|
import com.obs.services.exception.ObsException;
|
||||||
@ -480,9 +481,12 @@ public class HuaWeiCloudServiceImpl implements HuaWeiCloudService {
|
|||||||
@Override
|
@Override
|
||||||
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
|
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
|
||||||
try {
|
try {
|
||||||
return huaWeiCloudObsClient.getClient().copyObject(bucketName, key, targetBucketName, targetKey);
|
log.info("huaWeiCloudService#copyObject,params bucketName:{},key:{},targetBucketName:{},targetKey:{}", bucketName, key, targetBucketName, targetKey);
|
||||||
|
CopyObjectResult copyObjectResult = huaWeiCloudObsClient.getClient().copyObject(bucketName, key, targetBucketName, targetKey);
|
||||||
|
log.info("huaWeiCloudService#copyObject,params,bucketName:{},key:{},result:{}", bucketName, key, JSON.toJSONString(copyObjectResult));
|
||||||
|
return copyObjectResult;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("huaweicloud-copyToDict-exception, bucketName:{}, key:{}", bucketName, key, e);
|
log.warn("huaweicloud-copyToDict-exception, bucketName:{}, key:{},targetBucketName:{},targetKey:{}", bucketName, key, targetBucketName,targetKey, e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user