Commit fd97cd46 authored by tanyang's avatar tanyang

所有租户临时共用同一个oss云存储

parent d154a37e
......@@ -48,4 +48,15 @@ public interface GlobalConstants {
*/
String BATCH_IMPORT_FAIL_USERS = GLOBAL_REDIS_KEY + "batch_import_fail_users";
/**
* OSS配置
*/
String SYS_OSS_CONFIG = GLOBAL_REDIS_KEY + "sys_oss_config";
/**
* 默认配置KEY
*/
String DEFAULT_CONFIG_KEY = GLOBAL_REDIS_KEY + "sys_oss:default_config";
}
package com.dsk.oss.factory;
import com.dsk.common.constant.GlobalConstants;
import com.dsk.oss.constant.OssConstant;
import com.dsk.oss.exception.OssException;
import com.dsk.oss.properties.OssProperties;
......@@ -29,7 +30,7 @@ public class OssFactory {
*/
public static OssClient instance() {
// 获取redis 默认类型
String configKey = RedisUtils.getCacheObject(OssConstant.DEFAULT_CONFIG_KEY);
String configKey = RedisUtils.getCacheObject(GlobalConstants.DEFAULT_CONFIG_KEY);
if (StringUtils.isEmpty(configKey)) {
throw new OssException("文件存储服务类型无法找到!");
}
......@@ -40,7 +41,7 @@ public class OssFactory {
* 根据类型获取实例
*/
public static OssClient instance(String configKey) {
String json = CacheUtils.get(CacheNames.SYS_OSS_CONFIG, configKey);
String json = CacheUtils.get(GlobalConstants.SYS_OSS_CONFIG, configKey);
if (json == null) {
throw new OssException("系统异常, '" + configKey + "'配置信息不存在!");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment