Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
d1777411
Commit
d1777411
authored
May 12, 2020
by
ZhengJie
Browse files
[代码完善](v2.5): v2.5 beta 更新部分依赖,优化druid配置,其他杂项优化
Closes #339 2.5 Beta 详情:
https://www.ydyno.com/archives/1225.html
parent
3f7c8332
Changes
36
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
View file @
d1777411
...
...
@@ -82,7 +82,7 @@ public class UserController {
@ApiOperation
(
"查询用户"
)
@GetMapping
@PreAuthorize
(
"@el.check('user:list')"
)
public
ResponseEntity
<
Object
>
getUs
er
s
(
UserQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
<
Object
>
qu
er
y
(
UserQueryCriteria
criteria
,
Pageable
pageable
){
if
(!
ObjectUtils
.
isEmpty
(
criteria
.
getDeptId
()))
{
criteria
.
getDeptIds
().
add
(
criteria
.
getDeptId
());
criteria
.
getDeptIds
().
addAll
(
dataService
.
getDeptChildren
(
deptService
.
findByPid
(
criteria
.
getDeptId
())));
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
View file @
d1777411
...
...
@@ -92,6 +92,7 @@ public class MenuServiceImpl implements MenuService {
}
@Override
@Cacheable
(
key
=
"#p0"
)
public
List
<
MenuDto
>
findByRoles
(
List
<
RoleSmallDto
>
roles
)
{
Set
<
Long
>
roleIds
=
roles
.
stream
().
map
(
RoleSmallDto:
:
getId
).
collect
(
Collectors
.
toSet
());
LinkedHashSet
<
Menu
>
menus
=
menuRepository
.
findByRoles_IdInAndTypeNotOrderByMenuSortAsc
(
roleIds
,
2
);
...
...
eladmin-system/src/main/resources/config/application-dev.yml
View file @
d1777411
...
...
@@ -7,34 +7,42 @@ spring:
url
:
jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username
:
root
password
:
123456
# 初始化配置
initial-size
:
3
# 初始连接数
initial-size
:
5
# 最小连接数
min-idle
:
3
min-idle
:
10
# 最大连接数
max-active
:
15
max-active
:
20
# 获取连接超时时间
max-wait
:
5000
# 连接有效性检测时间
time-between-eviction-runs-millis
:
90000
# 最大空闲时间
min-evictable-idle-time-millis
:
1800000
time-between-eviction-runs-millis
:
60000
# 连接在池中最小生存的时间
min-evictable-idle-time-millis
:
300000
# 连接在池中最大生存的时间
max-evictable-idle-time-millis
:
900000
test-while-idle
:
true
test-on-borrow
:
false
test-on-return
:
false
# 检测连接是否有效
validation-query
:
select
1
# 配置监控统计拦截的filters
filters
:
stat
# 配置监控统计
webStatFilter
:
enabled
:
true
stat-view-servlet
:
enabled
:
true
url-pattern
:
/druid/*
reset-enable
:
false
web-stat-filter
:
url-pattern
:
/*
exclusions
:
"
*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
filter
:
stat
:
enabled
:
true
# 记录慢SQL
log-slow-sql
:
true
slow-sql-millis
:
1000
merge-sql
:
true
wall
:
config
:
multi-statement-allow
:
true
#jwt
jwt
:
header
:
Authorization
...
...
eladmin-system/src/main/resources/config/application-prod.yml
View file @
d1777411
...
...
@@ -7,36 +7,44 @@ spring:
url
:
jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username
:
root
password
:
123456
# 初始化配置
initial-size
:
3
# 初始连接数
initial-size
:
5
# 最小连接数
min-idle
:
3
min-idle
:
10
# 最大连接数
max-active
:
15
max-active
:
20
# 获取连接超时时间
max-wait
:
5000
# 连接有效性检测时间
time-between-eviction-runs-millis
:
90000
# 最大空闲时间
min-evictable-idle-time-millis
:
1800000
time-between-eviction-runs-millis
:
60000
# 连接在池中最小生存的时间
min-evictable-idle-time-millis
:
300000
# 连接在池中最大生存的时间
max-evictable-idle-time-millis
:
900000
test-while-idle
:
true
test-on-borrow
:
false
test-on-return
:
false
# 检测连接是否有效
validation-query
:
select
1
# 配置监控统计
拦截的filters
filters
:
stat
# 配置监控统计
webStatFilter
:
enabled
:
true
stat-view-servlet
:
enabled
:
true
url-pattern
:
/druid/*
reset-enable
:
false
login-username
:
admin
login-password
:
123456
web-stat-filter
:
url-pattern
:
/*
exclusions
:
"
*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
filter
:
stat
:
enabled
:
true
# 记录慢SQL
log-slow-sql
:
true
slow-sql-millis
:
1000
merge-sql
:
true
wall
:
config
:
multi-statement-allow
:
true
#jwt
jwt
:
header
:
Authorization
...
...
eladmin-system/src/main/resources/template/generator/admin/Controller.ftl
View file @
d1777411
...
...
@@ -32,7 +32,6 @@ import javax.servlet.http.HttpServletResponse;
/**
*
@website https://docs.auauz.net
*
@description /
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
@@ -56,7 +55,7 @@ public class ${className}Controller {
@
L
og
(
"查询${apiAlias}"
)
@
A
piOperation
(
"查询${apiAlias}"
)
@
P
reAuthorize
(
"@el.check('${changeClassName}:list')"
)
public
R
esponseEntity
<
O
bject
>
get
$
{
className
}
s
(
$
{
className
}
Q
ueryCriteria
criteria
,
P
ageable
pageable
){
public
R
esponseEntity
<
O
bject
>
query
(
$
{
className
}
Q
ueryCriteria
criteria
,
P
ageable
pageable
){
return
new
R
esponseEntity
<>
(
$
{
changeClassName
}
S
ervice
.queryAll
(
criteria
,
pageable
),
H
ttpStatus
.OK
)
;
}
...
...
@@ -81,7 +80,7 @@ public class ${className}Controller {
@
A
piOperation
(
"删除${apiAlias}"
)
@
P
reAuthorize
(
"@el.check('${changeClassName}:del')"
)
@
D
eleteMapping
public
R
esponseEntity
<
O
bject
>
delete
All
(
@
R
equestBody
$
{
pkColumnType
}
[]
ids
)
{
public
R
esponseEntity
<
O
bject
>
delete
(
@
R
equestBody
$
{
pkColumnType
}
[]
ids
)
{
$
{
changeClassName
}
S
ervice
.deleteAll
(
ids
)
;
return
new
R
esponseEntity
<>
(
H
ttpStatus
.OK
)
;
}
...
...
eladmin-system/src/main/resources/template/generator/admin/Mapper.ftl
View file @
d1777411
...
...
@@ -23,7 +23,6 @@ import org.mapstruct.ReportingPolicy;
/**
*
@website https://docs.auauz.net
*
@description /
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
eladmin-system/src/main/resources/template/generator/admin/QueryCriteria.ftl
View file @
d1777411
...
...
@@ -31,7 +31,6 @@ import me.zhengjie.annotation.Query;
/**
*
@website https://docs.auauz.net
*
@description /
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
eladmin-system/src/main/resources/template/generator/admin/Repository.ftl
View file @
d1777411
...
...
@@ -21,7 +21,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
*
@website https://docs.auauz.net
*
@description /
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
eladmin-system/src/main/resources/template/generator/admin/Service.ftl
View file @
d1777411
...
...
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletResponse;
/**
*
@website https://docs.auauz.net
*
@description
/
*
@description
服务接口
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
View file @
d1777411
...
...
@@ -56,7 +56,7 @@ import java.util.LinkedHashMap;
/**
*
@website https://docs.auauz.net
*
@description
/
*
@description
服务实现
*
@author $
{
author
}
*
@date $
{
date
}
**/
...
...
eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
View file @
d1777411
...
...
@@ -51,14 +51,14 @@ public class AliPayController {
private
final
AliPayService
alipayService
;
@GetMapping
public
ResponseEntity
<
AlipayConfig
>
get
(){
public
ResponseEntity
<
AlipayConfig
>
queryConfig
(){
return
new
ResponseEntity
<>(
alipayService
.
find
(),
HttpStatus
.
OK
);
}
@Log
(
"配置支付宝"
)
@ApiOperation
(
"配置支付宝"
)
@PutMapping
public
ResponseEntity
<
Object
>
pay
Config
(
@Validated
@RequestBody
AlipayConfig
alipayConfig
){
public
ResponseEntity
<
Object
>
update
Config
(
@Validated
@RequestBody
AlipayConfig
alipayConfig
){
alipayConfig
.
setId
(
1L
);
alipayService
.
update
(
alipayConfig
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
View file @
d1777411
...
...
@@ -41,14 +41,14 @@ public class EmailController {
private
final
EmailService
emailService
;
@GetMapping
public
ResponseEntity
<
Object
>
get
(){
public
ResponseEntity
<
Object
>
queryConfig
(){
return
new
ResponseEntity
<>(
emailService
.
find
(),
HttpStatus
.
OK
);
}
@Log
(
"配置邮件"
)
@PutMapping
@ApiOperation
(
"配置邮件"
)
public
ResponseEntity
<
Object
>
email
Config
(
@Validated
@RequestBody
EmailConfig
emailConfig
){
public
ResponseEntity
<
Object
>
update
Config
(
@Validated
@RequestBody
EmailConfig
emailConfig
){
emailService
.
update
(
emailConfig
,
emailService
.
find
());
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
@@ -56,7 +56,7 @@ public class EmailController {
@Log
(
"发送邮件"
)
@PostMapping
@ApiOperation
(
"发送邮件"
)
public
ResponseEntity
<
Object
>
send
(
@Validated
@RequestBody
EmailVo
emailVo
)
throws
Exception
{
public
ResponseEntity
<
Object
>
send
Email
(
@Validated
@RequestBody
EmailVo
emailVo
)
throws
Exception
{
emailService
.
send
(
emailVo
,
emailService
.
find
());
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
View file @
d1777411
...
...
@@ -47,7 +47,7 @@ public class LocalStorageController {
@ApiOperation
(
"查询文件"
)
@GetMapping
@PreAuthorize
(
"@el.check('storage:list')"
)
public
ResponseEntity
<
Object
>
getLocalStorages
(
LocalStorageQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
<
Object
>
query
(
LocalStorageQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
localStorageService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
...
...
@@ -77,7 +77,7 @@ public class LocalStorageController {
@Log
(
"多选删除"
)
@DeleteMapping
@ApiOperation
(
"多选删除"
)
public
ResponseEntity
<
Object
>
delete
All
(
@RequestBody
Long
[]
ids
)
{
public
ResponseEntity
<
Object
>
delete
(
@RequestBody
Long
[]
ids
)
{
localStorageService
.
deleteAll
(
ids
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
eladmin-tools/src/main/java/me/zhengjie/rest/PictureController.java
View file @
d1777411
...
...
@@ -48,7 +48,7 @@ public class PictureController {
@PreAuthorize
(
"@el.check('pictures:list')"
)
@GetMapping
@ApiOperation
(
"查询图片"
)
public
ResponseEntity
<
Object
>
getRoles
(
PictureQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
<
Object
>
query
(
PictureQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
pictureService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
...
...
@@ -82,7 +82,7 @@ public class PictureController {
@ApiOperation
(
"多选删除图片"
)
@PreAuthorize
(
"@el.check('pictures:del')"
)
@DeleteMapping
public
ResponseEntity
<
Object
>
delete
All
(
@RequestBody
Long
[]
ids
)
{
public
ResponseEntity
<
Object
>
delete
(
@RequestBody
Long
[]
ids
)
{
pictureService
.
deleteAll
(
ids
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
View file @
d1777411
...
...
@@ -50,14 +50,14 @@ public class QiniuController {
private
final
QiNiuService
qiNiuService
;
@GetMapping
(
value
=
"/config"
)
public
ResponseEntity
<
Object
>
get
(){
public
ResponseEntity
<
Object
>
queryConfig
(){
return
new
ResponseEntity
<>(
qiNiuService
.
find
(),
HttpStatus
.
OK
);
}
@Log
(
"配置七牛云存储"
)
@ApiOperation
(
"配置七牛云存储"
)
@PutMapping
(
value
=
"/config"
)
public
ResponseEntity
<
Object
>
email
Config
(
@Validated
@RequestBody
QiniuConfig
qiniuConfig
){
public
ResponseEntity
<
Object
>
update
Config
(
@Validated
@RequestBody
QiniuConfig
qiniuConfig
){
qiNiuService
.
update
(
qiniuConfig
);
qiNiuService
.
update
(
qiniuConfig
.
getType
());
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
@@ -73,7 +73,7 @@ public class QiniuController {
@Log
(
"查询文件"
)
@ApiOperation
(
"查询文件"
)
@GetMapping
public
ResponseEntity
<
Object
>
getRoles
(
QiniuQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
<
Object
>
query
(
QiniuQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
qiNiuService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
...
...
pom.xml
View file @
d1777411
...
...
@@ -33,44 +33,51 @@
<jedis.version>
2.9.0
</jedis.version>
<log4jdbc.version>
1.16
</log4jdbc.version>
<swagger.version>
2.9.2
</swagger.version>
<fastjson.version>
1.2.
54
</fastjson.version>
<druid.version>
1.1.1
0
</druid.version>
<fastjson.version>
1.2.
68
</fastjson.version>
<druid.version>
1.1.1
4
</druid.version>
<commons-pool2.version>
2.5.0
</commons-pool2.version>
<mapstruct.version>
1.2.0.Final
</mapstruct.version>
</properties>
<dependencies>
<!--Spring boot
start
-->
<!--Spring boot
核心
-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
</dependency>
<!--Spring boot Web容器-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!--Spring boot 测试-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!--Spring boot 安全框架-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<!-- spring cache -->
<!-- spring boot 缓存 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-cache
</artifactId>
</dependency>
<!-- redis -->
<!--Spring boot Redis-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<!--Spring boot end-->
<!--spring
2.0
集成redis所需common-pool2-->
<!--spring
boot
集成redis所需common-pool2-->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
...
...
@@ -88,7 +95,7 @@
<version>
${log4jdbc.version}
</version>
</dependency>
<!--
RESTful APIs swagger2
-->
<!--
Swagger UI 相关
-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
...
...
@@ -126,6 +133,7 @@
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
<!-- druid数据源驱动 -->
<dependency>
<groupId>
com.alibaba
</groupId>
...
...
@@ -140,6 +148,7 @@
<optional>
true
</optional>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
...
...
@@ -150,7 +159,6 @@
<artifactId>
poi-ooxml
</artifactId>
<version>
3.17
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
<dependency>
<groupId>
xerces
</groupId>
<artifactId>
xercesImpl
</artifactId>
...
...
@@ -163,6 +171,7 @@
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<!--mapStruct依赖-->
<dependency>
<groupId>
org.mapstruct
</groupId>
...
...
@@ -180,11 +189,15 @@
<artifactId>
javax.inject
</artifactId>
<version>
1
</version>
</dependency>
<!-- Java图形验证码 -->
<dependency>
<groupId>
com.github.whvcse
</groupId>
<artifactId>
easy-captcha
</artifactId>
<version>
1.6.2
</version>
</dependency>
<!-- 解析客户端操作系统、浏览器信息 -->
<dependency>
<groupId>
eu.bitwalker
</groupId>
<artifactId>
UserAgentUtils
</artifactId>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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