feat:(REQ-3540) 文件复制接口与阿里云/华为云对接日志添加

This commit is contained in:
xudawei 2025-03-11 13:47:23 +08:00
parent 503826f5ca
commit a4c336b4cb
2 changed files with 11 additions and 3 deletions

View File

@ -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.AliOssClient;
import cn.azxo.framework.common.utils.LogUtil;
import com.alibaba.fastjson.JSON;
import com.aliyun.oss.HttpMethod;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSException;
@ -423,7 +424,10 @@ public class AliOssServiceImpl implements AliOssService {
@Override
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
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) {
log.warn("aliyun-copyObject-exception, bucketName:{}, key:{}", bucketName, key, e);
return null;

View File

@ -10,6 +10,7 @@ import cn.axzo.oss.integration.s3.config.HuaWeiCloudObsConfig;
import cn.azxo.framework.common.utils.LogUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import com.obs.services.ObsClient;
import com.obs.services.exception.ObsException;
@ -480,9 +481,12 @@ public class HuaWeiCloudServiceImpl implements HuaWeiCloudService {
@Override
public CopyObjectResult copyObject(String bucketName, String key, String targetBucketName, String targetKey) {
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) {
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;
}
}