mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update OSS 模块 整体重命名 消除歧义
This commit is contained in:
@ -15,7 +15,7 @@ import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.oss.constant.CloudConstant;
|
||||
import com.ruoyi.oss.constant.OssConstant;
|
||||
import com.ruoyi.oss.factory.OssFactory;
|
||||
import com.ruoyi.system.domain.SysOssConfig;
|
||||
import com.ruoyi.system.domain.bo.SysOssConfigBo;
|
||||
@ -54,7 +54,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
for (SysOssConfig config : list) {
|
||||
String configKey = config.getConfigKey();
|
||||
if ("0".equals(config.getStatus())) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, configKey);
|
||||
RedisUtils.setCacheObject(OssConstant.CACHE_CONFIG_KEY, configKey);
|
||||
}
|
||||
setConfigCache(true, config);
|
||||
}
|
||||
@ -114,7 +114,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
if (CollUtil.containsAny(ids, CloudConstant.SYSTEM_DATA_IDS)) {
|
||||
if (CollUtil.containsAny(ids, OssConstant.SYSTEM_DATA_IDS)) {
|
||||
throw new ServiceException("系统内置, 不可删除!");
|
||||
}
|
||||
}
|
||||
@ -157,7 +157,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
.set(SysOssConfig::getStatus, "1"));
|
||||
row += baseMapper.updateById(sysOssConfig);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(CloudConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
|
||||
RedisUtils.setCacheObject(OssConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
|
||||
}
|
||||
return row;
|
||||
}
|
||||
@ -169,7 +169,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
* @return 缓存键key
|
||||
*/
|
||||
private String getCacheKey(String configKey) {
|
||||
return CloudConstant.SYS_OSS_KEY + configKey;
|
||||
return OssConstant.SYS_OSS_KEY + configKey;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,7 +184,7 @@ public class SysOssConfigServiceImpl extends ServicePlusImpl<SysOssConfigMapper,
|
||||
RedisUtils.setCacheObject(
|
||||
getCacheKey(config.getConfigKey()),
|
||||
JsonUtils.toJsonString(config));
|
||||
RedisUtils.publish(CloudConstant.CACHE_CONFIG_KEY, config.getConfigKey(), msg -> {
|
||||
RedisUtils.publish(OssConstant.CACHE_CONFIG_KEY, config.getConfigKey(), msg -> {
|
||||
log.info("发布刷新OSS配置 => " + msg);
|
||||
});
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.oss.entity.UploadResult;
|
||||
import com.ruoyi.oss.factory.OssFactory;
|
||||
import com.ruoyi.oss.service.ICloudStorageStrategy;
|
||||
import com.ruoyi.oss.service.IOssStrategy;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import com.ruoyi.system.domain.bo.SysOssBo;
|
||||
import com.ruoyi.system.domain.vo.SysOssVo;
|
||||
@ -56,7 +56,7 @@ public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, Sys
|
||||
public SysOss upload(MultipartFile file) {
|
||||
String originalfileName = file.getOriginalFilename();
|
||||
String suffix = StringUtils.substring(originalfileName, originalfileName.lastIndexOf("."), originalfileName.length());
|
||||
ICloudStorageStrategy storage = OssFactory.instance();
|
||||
IOssStrategy storage = OssFactory.instance();
|
||||
UploadResult uploadResult;
|
||||
try {
|
||||
uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType());
|
||||
@ -81,7 +81,7 @@ public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss, Sys
|
||||
}
|
||||
List<SysOss> list = listByIds(ids);
|
||||
for (SysOss sysOss : list) {
|
||||
ICloudStorageStrategy storage = OssFactory.instance(sysOss.getService());
|
||||
IOssStrategy storage = OssFactory.instance(sysOss.getService());
|
||||
storage.delete(sysOss.getUrl());
|
||||
}
|
||||
return removeByIds(ids);
|
||||
|
Reference in New Issue
Block a user