fix:删除遗留引用
This commit is contained in:
parent
af5e866853
commit
ecb330cc57
@ -5,10 +5,12 @@ import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.modules.file.entity.enums.OssEnum;
|
||||
import cn.lili.modules.file.plugin.FilePlugin;
|
||||
import cn.lili.modules.system.entity.dto.OssSetting;
|
||||
|
||||
import com.obs.services.ObsClient;
|
||||
import com.obs.services.exception.ObsException;
|
||||
import com.obs.services.model.*;
|
||||
import com.obs.services.model.DeleteObjectsRequest;
|
||||
import com.obs.services.model.DeleteObjectsResult;
|
||||
import com.obs.services.model.ListVersionsResult;
|
||||
import com.obs.services.model.PutObjectRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
@ -20,8 +22,6 @@ import java.util.List;
|
||||
* 华为obs 文件操作
|
||||
*
|
||||
* @author Bulbasaur
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@ -72,7 +72,7 @@ public class HuaweiFilePlugin implements FilePlugin {
|
||||
public String inputStreamUpload(InputStream inputStream, String key) {
|
||||
ObsClient obsClient = getObsClient();
|
||||
try {
|
||||
PutObjectRequest putObjectRequest=new PutObjectRequest(ossSetting.getHuaweicloudOBSBucketName(), key, inputStream);
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(ossSetting.getHuaweicloudOBSBucketName(), key, inputStream);
|
||||
obsClient.putObject(putObjectRequest);
|
||||
} catch (ObsException obsException) {
|
||||
obsException.printStackTrace();
|
||||
|
@ -14,7 +14,6 @@ import com.qcloud.cos.exception.CosServiceException;
|
||||
import com.qcloud.cos.http.HttpProtocol;
|
||||
import com.qcloud.cos.model.DeleteObjectsRequest;
|
||||
import com.qcloud.cos.model.ObjectMetadata;
|
||||
import com.qcloud.cos.model.PutObjectRequest;
|
||||
import com.qcloud.cos.region.Region;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -66,7 +65,6 @@ public class TencentFilePlugin implements FilePlugin {
|
||||
* @return
|
||||
*/
|
||||
private String getUrlPrefix() {
|
||||
// return "https://" + ossSetting.getTencentCOSBucket() + "." + ossSetting.getTencentCOSEndPoint() + "/";
|
||||
return "https://" + ossSetting.getTencentCOSBucket() + ".cos" + ossSetting.getTencentCOSEndPoint() + ".myqcloud.com/";
|
||||
}
|
||||
|
||||
@ -108,7 +106,7 @@ public class TencentFilePlugin implements FilePlugin {
|
||||
|
||||
try {
|
||||
List<DeleteObjectsRequest.KeyVersion> delObjects = new ArrayList<>();
|
||||
for (String key:keys) {
|
||||
for (String key : keys) {
|
||||
delObjects.add(new DeleteObjectsRequest.KeyVersion(key));
|
||||
}
|
||||
cosClient.deleteObjects(new DeleteObjectsRequest(ossSetting.getTencentCOSBucket()).withKeys(delObjects));
|
||||
|
@ -2,7 +2,6 @@ package cn.lili.modules.goods.serviceimpl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.modules.file.entity.enums.OssEnum;
|
||||
import cn.lili.modules.file.util.FileUtil;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
||||
import cn.lili.modules.goods.mapper.GoodsGalleryMapper;
|
||||
import cn.lili.modules.goods.service.GoodsGalleryService;
|
||||
@ -108,7 +107,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl<GoodsGalleryMapper, Goo
|
||||
return url + "?x-oss-process=style/" + width + "X" + height;
|
||||
case HUAWEI_OBS:
|
||||
//缩略图全路径
|
||||
return url + "?image/resize,m_fixed,h_"+height+",w_"+width;
|
||||
return url + "?image/resize,m_fixed,h_" + height + ",w_" + width;
|
||||
case TENCENT_COS:
|
||||
//缩略图全路径
|
||||
return url + "?imageMogr2/thumbnail/" + width + "x" + height;
|
||||
|
@ -112,9 +112,9 @@ public class KdniaoPlugin implements LogisticsPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> labelOrder(LabelOrderDTO labelOrderDTO) {
|
||||
public Map<String, Object> labelOrder(LabelOrderDTO labelOrderDTO) {
|
||||
try {
|
||||
Map<String,Object> resultMap = new HashMap();
|
||||
Map<String, Object> resultMap = new HashMap();
|
||||
//订单
|
||||
Order order = labelOrderDTO.getOrder();
|
||||
//订单货物
|
||||
@ -206,7 +206,7 @@ public class KdniaoPlugin implements LogisticsPlugin {
|
||||
}
|
||||
|
||||
JSONObject orderJson = JSONObject.parseObject(obj.getString("Order"));
|
||||
resultMap.put("printTemplate",obj.getString("PrintTemplate"));
|
||||
resultMap.put("printTemplate", obj.getString("PrintTemplate"));
|
||||
return resultMap;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -122,7 +122,7 @@ public class Kuaidi100Plugin implements LogisticsPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> labelOrder(LabelOrderDTO labelOrderDTO) {
|
||||
public Map<String, Object> labelOrder(LabelOrderDTO labelOrderDTO) {
|
||||
try {
|
||||
//订单
|
||||
Order order = labelOrderDTO.getOrder();
|
||||
|
Loading…
x
Reference in New Issue
Block a user