|
|
@ -8,6 +8,7 @@ |
|
|
|
|
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.cloud.AbstractCloudStorageService; |
|
|
@ -192,6 +193,7 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { |
|
|
|
logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); |
|
|
|
String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); |
|
|
|
String fileName = strings[strings.length - 1]; |
|
|
|
OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); |
|
|
@ -206,6 +208,7 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement |
|
|
|
fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; |
|
|
|
String key = RedisKeys.getOssFileKey(formDTO.getUrl()); |
|
|
|
redisUtils.delete(key); |
|
|
|
logger.info("articleRemoveFile oss delete fileName:{}", JSON.toJSONString(fileName)); |
|
|
|
return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); |
|
|
|
} |
|
|
|
|
|
|
|