Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
多鱼的夏天
RuoYi-Cloud-Docker
提交
e100b0b9
R
RuoYi-Cloud-Docker
项目概览
多鱼的夏天
/
RuoYi-Cloud-Docker
通知
209
Star
7
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RuoYi-Cloud-Docker
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e100b0b9
编写于
12月 22, 2020
作者:
R
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加分布式文件Minio支持
上级
161a6249
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
136 addition
and
3 deletion
+136
-3
pom.xml
pom.xml
+1
-0
ruoyi-modules/ruoyi-file/pom.xml
ruoyi-modules/ruoyi-file/pom.xml
+7
-0
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java
...file/src/main/java/com/ruoyi/file/config/MinioConfig.java
+82
-0
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
...ava/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
+1
-1
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
.../java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
+0
-1
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
.../java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
+44
-0
sql/ry_config_20201222.sql
sql/ry_config_20201222.sql
+1
-1
未找到文件。
pom.xml
浏览文件 @
e100b0b9
...
...
@@ -33,6 +33,7 @@
<commons.fileupload.version>
1.3.3
</commons.fileupload.version>
<velocity.version>
1.7
</velocity.version>
<fastjson.version>
1.2.74
</fastjson.version>
<minio.version>
8.0.3
</minio.version>
<poi.version>
4.1.2
</poi.version>
<common-pool.version>
2.6.2
</common-pool.version>
</properties>
...
...
ruoyi-modules/ruoyi-file/pom.xml
浏览文件 @
e100b0b9
...
...
@@ -54,6 +54,13 @@
<artifactId>
fastdfs-client
</artifactId>
</dependency>
<!-- Minio -->
<dependency>
<groupId>
io.minio
</groupId>
<artifactId>
minio
</artifactId>
<version>
${minio.version}
</version>
</dependency>
<!-- RuoYi Api System -->
<dependency>
<groupId>
com.ruoyi
</groupId>
...
...
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java
0 → 100644
浏览文件 @
e100b0b9
package
com.ruoyi.file.config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
io.minio.MinioClient
;
/**
* Minio 配置信息
*
* @author ruoiy
*/
@Configuration
@ConfigurationProperties
(
prefix
=
"minio"
)
public
class
MinioConfig
{
/**
* 服务地址
*/
private
String
url
;
/**
* 用户名
*/
private
String
accessKey
;
/**
* 密码
*/
private
String
secretKey
;
/**
* 存储桶名称
*/
private
String
bucketName
;
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getAccessKey
()
{
return
accessKey
;
}
public
void
setAccessKey
(
String
accessKey
)
{
this
.
accessKey
=
accessKey
;
}
public
String
getSecretKey
()
{
return
secretKey
;
}
public
void
setSecretKey
(
String
secretKey
)
{
this
.
secretKey
=
secretKey
;
}
public
String
getBucketName
()
{
return
bucketName
;
}
public
void
setBucketName
(
String
bucketName
)
{
this
.
bucketName
=
bucketName
;
}
@Bean
public
MinioClient
getMinioClient
()
{
return
MinioClient
.
builder
().
endpoint
(
url
).
credentials
(
accessKey
,
secretKey
).
build
();
}
}
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
浏览文件 @
e100b0b9
...
...
@@ -9,7 +9,7 @@ import com.github.tobato.fastdfs.domain.fdfs.StorePath;
import
com.github.tobato.fastdfs.service.FastFileStorageClient
;
/**
* FastDFS文件存储
* FastDFS
文件存储
*
* @author ruoyi
*/
...
...
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
浏览文件 @
e100b0b9
...
...
@@ -37,7 +37,6 @@ public class LocalSysFileServiceImpl implements ISysFileService
* 本地文件上传接口
*
* @param file 上传的文件
* @param baseDir 相对应用的基目录
* @return 访问地址
* @throws Exception
*/
...
...
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
0 → 100644
浏览文件 @
e100b0b9
package
com.ruoyi.file.service
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.ruoyi.file.config.MinioConfig
;
import
com.ruoyi.file.utils.FileUploadUtils
;
import
io.minio.MinioClient
;
import
io.minio.PutObjectArgs
;
/**
* Minio 文件存储
*
* @author ruoyi
*/
@Service
public
class
MinioSysFileServiceImpl
implements
ISysFileService
{
@Autowired
private
MinioConfig
minioConfig
;
@Autowired
private
MinioClient
client
;
/**
* 本地文件上传接口
*
* @param file 上传的文件
* @return 访问地址
* @throws Exception
*/
public
String
uploadFile
(
MultipartFile
file
)
throws
Exception
{
String
fileName
=
FileUploadUtils
.
extractFilename
(
file
);
PutObjectArgs
args
=
PutObjectArgs
.
builder
()
.
bucket
(
minioConfig
.
getBucketName
())
.
object
(
fileName
)
.
stream
(
file
.
getInputStream
(),
file
.
getSize
(),
-
1
)
.
contentType
(
file
.
getContentType
())
.
build
();
client
.
putObject
(
args
);
return
minioConfig
.
getUrl
()
+
"/"
+
minioConfig
.
getBucketName
()
+
"/"
+
fileName
;
}
}
sql/ry_config_2020122
1
.sql
→
sql/ry_config_2020122
2
.sql
浏览文件 @
e100b0b9
...
...
@@ -39,7 +39,7 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod
(
5
,
'ruoyi-system-dev.yml'
,
'DEFAULT_GROUP'
,
'# spring配置
\r\n
spring:
\r\n
redis:
\r\n
host: localhost
\r\n
port: 6379
\r\n
password:
\r\n
datasource:
\r\n
druid:
\r\n
stat-view-servlet:
\r\n
enabled: true
\r\n
loginUsername: admin
\r\n
loginPassword: 123456
\r\n
dynamic:
\r\n
druid:
\r\n
initial-size: 5
\r\n
min-idle: 5
\r\n
maxActive: 20
\r\n
maxWait: 60000
\r\n
timeBetweenEvictionRunsMillis: 60000
\r\n
minEvictableIdleTimeMillis: 300000
\r\n
validationQuery: SELECT 1 FROM DUAL
\r\n
testWhileIdle: true
\r\n
testOnBorrow: false
\r\n
testOnReturn: false
\r\n
poolPreparedStatements: true
\r\n
maxPoolPreparedStatementPerConnectionSize: 20
\r\n
filters: stat,wall,slf4j
\r\n
connectionProperties: druid.stat.mergeSql
\\
=true;druid.stat.slowSqlMillis
\\
=5000
\r\n
datasource:
\r\n
# 主库数据源
\r\n
master:
\r\n
driver-class-name: com.mysql.cj.jdbc.Driver
\r\n
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
\r\n
username: root
\r\n
password: password
\r\n
# 从库数据源
\r\n
# slave:
\r\n
# url:
\r\n
# username:
\r\n
# password:
\r\n
# driver-class-name:
\r\n\r\n
# mybatis配置
\r\n
mybatis:
\r\n
# 搜索指定包别名
\r\n
typeAliasesPackage: com.ruoyi.system
\r\n
# 配置mapper的扫描,找到所有的mapper.xml映射文件
\r\n
mapperLocations: classpath:mapper/**/*.xml
\r\n\r\n
# swagger配置
\r\n
swagger:
\r\n
title: 系统模块接口文档
\r\n
license: Powered By ruoyi
\r\n
licenseUrl: https://ruoyi.vip
\r\n
authorization:
\r\n
name: RuoYi OAuth
\r\n
auth-regex: ^.*$
\r\n
authorization-scope-list:
\r\n
- scope: server
\r\n
description: 客户端授权范围
\r\n
token-url-list:
\r\n
- http://localhost:8080/auth/oauth/token
\r\n
'
,
'c8eede0126999265ffb465a21502add7'
,
'2020-11-20 00:00:00'
,
'2020-12-21 16:27:55'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'系统模块'
,
'null'
,
'null'
,
'yaml'
,
'null'
),
(
6
,
'ruoyi-gen-dev.yml'
,
'DEFAULT_GROUP'
,
'# spring配置
\r\n
spring:
\r\n
redis:
\r\n
host: localhost
\r\n
port: 6379
\r\n
password:
\r\n
datasource:
\r\n
driver-class-name: com.mysql.cj.jdbc.Driver
\r\n
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
\r\n
username: root
\r\n
password: password
\r\n\r\n
# mybatis配置
\r\n
mybatis:
\r\n
# 搜索指定包别名
\r\n
typeAliasesPackage: com.ruoyi.gen.domain
\r\n
# 配置mapper的扫描,找到所有的mapper.xml映射文件
\r\n
mapperLocations: classpath:mapper/**/*.xml
\r\n\r\n
# swagger配置
\r\n
swagger:
\r\n
title: 代码生成接口文档
\r\n
license: Powered By ruoyi
\r\n
licenseUrl: https://ruoyi.vip
\r\n
authorization:
\r\n
name: RuoYi OAuth
\r\n
auth-regex: ^.*$
\r\n
authorization-scope-list:
\r\n
- scope: server
\r\n
description: 客户端授权范围
\r\n
token-url-list:
\r\n
- http://localhost:8080/auth/oauth/token
\r\n\r\n
# 代码生成
\r\n
gen:
\r\n
# 作者
\r\n
author: ruoyi
\r\n
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
\r\n
packageName: com.ruoyi.system
\r\n
# 自动去除表前缀,默认是false
\r\n
autoRemovePre: false
\r\n
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
\r\n
tablePrefix: sys_
\r\n
'
,
'5554d54c838876bf2372934c0631aa1b'
,
'2020-11-20 00:00:00'
,
'2020-12-21 16:23:44'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'代码生成'
,
'null'
,
'null'
,
'yaml'
,
'null'
),
(
7
,
'ruoyi-job-dev.yml'
,
'DEFAULT_GROUP'
,
'# spring配置
\r\n
spring:
\r\n
redis:
\r\n
host: localhost
\r\n
port: 6379
\r\n
password:
\r\n
datasource:
\r\n
driver-class-name: com.mysql.cj.jdbc.Driver
\r\n
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
\r\n
username: root
\r\n
password: password
\r\n\r\n
# mybatis配置
\r\n
mybatis:
\r\n
# 搜索指定包别名
\r\n
typeAliasesPackage: com.ruoyi.job.domain
\r\n
# 配置mapper的扫描,找到所有的mapper.xml映射文件
\r\n
mapperLocations: classpath:mapper/**/*.xml
\r\n\r\n
# swagger配置
\r\n
swagger:
\r\n
title: 定时任务接口文档
\r\n
license: Powered By ruoyi
\r\n
licenseUrl: https://ruoyi.vip
\r\n
authorization:
\r\n
name: RuoYi OAuth
\r\n
auth-regex: ^.*$
\r\n
authorization-scope-list:
\r\n
- scope: server
\r\n
description: 客户端授权范围
\r\n
token-url-list:
\r\n
- http://localhost:8080/auth/oauth/token
\r\n
'
,
'b187acdcbfb8be114f0570bc569ca96d'
,
'2020-11-20 00:00:00'
,
'2020-12-21 16:24:07'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'定时任务'
,
'null'
,
'null'
,
'yaml'
,
'null'
),
(
8
,
'ruoyi-file-dev.yml'
,
'DEFAULT_GROUP'
,
'# 本地文件上传
\r\n
file:
\r\n
domain: http://127.0.0.1:9300
\r\n
path: D:/ruoyi/uploadPath
\r\n
prefix: /statics
\r\n\r\n
# FastDFS配置
\r\n
fdfs:
\r\n
domain: http://8.129.231.12
\r\n
soTimeout: 3000
\r\n
connectTimeout: 2000
\r\n
trackerList: 8.129.231.12:22122
'
,
'fef11efa9f6d37021ccd7efa8c48bfb2'
,
'2020-11-20 00:00:00'
,
'2020-12-21 16:24:26
'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'文件服务'
,
'null'
,
'null'
,
'yaml'
,
'null'
),
(
8
,
'ruoyi-file-dev.yml'
,
'DEFAULT_GROUP'
,
'# 本地文件上传
\r\n
file:
\r\n
domain: http://127.0.0.1:9300
\r\n
path: D:/ruoyi/uploadPath
\r\n
prefix: /statics
\r\n\r\n
# FastDFS配置
\r\n
fdfs:
\r\n
domain: http://8.129.231.12
\r\n
soTimeout: 3000
\r\n
connectTimeout: 2000
\r\n
trackerList: 8.129.231.12:22122
\r\n\r\n
# Minio配置
\r\n
minio:
\r\n
url: http://8.129.231.12:9000
\r\n
accessKey: minioadmin
\r\n
secretKey: minioadmin
\r\n
bucketName: test'
,
'5382b93f3d8059d6068c0501fdd41195'
,
'2020-11-20 00:00:00'
,
'2020-12-21 21:01:59
'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'文件服务'
,
'null'
,
'null'
,
'yaml'
,
'null'
),
(
9
,
'sentinel-ruoyi-gateway'
,
'DEFAULT_GROUP'
,
'[
\r\n
{
\r\n
\"
resource
\"
:
\"
ruoyi-auth
\"
,
\r\n
\"
count
\"
: 500,
\r\n
\"
grade
\"
: 1,
\r\n
\"
limitApp
\"
:
\"
default
\"
,
\r\n
\"
strategy
\"
: 0,
\r\n
\"
controlBehavior
\"
: 0
\r\n
},
\r\n
{
\r\n
\"
resource
\"
:
\"
ruoyi-system
\"
,
\r\n
\"
count
\"
: 1000,
\r\n
\"
grade
\"
: 1,
\r\n
\"
limitApp
\"
:
\"
default
\"
,
\r\n
\"
strategy
\"
: 0,
\r\n
\"
controlBehavior
\"
: 0
\r\n
},
\r\n
{
\r\n
\"
resource
\"
:
\"
ruoyi-gen
\"
,
\r\n
\"
count
\"
: 200,
\r\n
\"
grade
\"
: 1,
\r\n
\"
limitApp
\"
:
\"
default
\"
,
\r\n
\"
strategy
\"
: 0,
\r\n
\"
controlBehavior
\"
: 0
\r\n
},
\r\n
{
\r\n
\"
resource
\"
:
\"
ruoyi-job
\"
,
\r\n
\"
count
\"
: 300,
\r\n
\"
grade
\"
: 1,
\r\n
\"
limitApp
\"
:
\"
default
\"
,
\r\n
\"
strategy
\"
: 0,
\r\n
\"
controlBehavior
\"
: 0
\r\n
}
\r\n
]'
,
'9f3a3069261598f74220bc47958ec252'
,
'2020-11-20 00:00:00'
,
'2020-11-20 00:00:00'
,
NULL
,
'0:0:0:0:0:0:0:1'
,
''
,
''
,
'限流策略'
,
'null'
,
'null'
,
'json'
,
'null'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录