Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
fd97cd46
Commit
fd97cd46
authored
Nov 23, 2023
by
tanyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有租户临时共用同一个oss云存储
parent
d154a37e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
GlobalConstants.java
...rc/main/java/com/dsk/common/constant/GlobalConstants.java
+11
-0
OssFactory.java
dsk-oss/src/main/java/com/dsk/oss/factory/OssFactory.java
+3
-2
No files found.
dsk-common/src/main/java/com/dsk/common/constant/GlobalConstants.java
View file @
fd97cd46
...
...
@@ -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"
;
}
dsk-oss/src/main/java/com/dsk/oss/factory/OssFactory.java
View file @
fd97cd46
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
(
CacheName
s
.
SYS_OSS_CONFIG
,
configKey
);
String
json
=
CacheUtils
.
get
(
GlobalConstant
s
.
SYS_OSS_CONFIG
,
configKey
);
if
(
json
==
null
)
{
throw
new
OssException
(
"系统异常, '"
+
configKey
+
"'配置信息不存在!"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment