Skip to content

Commit 20c060c

Browse files
Merge pull request #97 from geekidea/dev
spring-boot-plus V1.4.0发布 集成用户角色权限部门管理
2 parents cca307b + 63543b9 commit 20c060c

28 files changed

+410
-157
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ logs
3232

3333
*.rdb
3434

35+
36+

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@
1212
- 自定义是否启用Shiro权限拦截
1313
- 优化LogAop配置
1414
- 代码生成模板优化,三种生成策略
15+
- 自定义生成Shiro `RequiresPermissions`注解
16+
- `Jackson`工具类,按字段顺序格式化输出
17+
- `BaseEnum` 枚举父接口,`EnumController`,`BaseEnumUtil`, `EnumTypeValidator` 校验/获取枚举信息
1518

1619
### 🐞 Bug Fixes
17-
- fix #81 刷新token问题
20+
- fix #81 刷新token问题
1821
- fix 获取角色token问题
1922
- fix refreshToken方法和LoginUtil工具类方法问题
2023

2124
### 📔 Documentation
25+
- [RBAC用户角色权限](https://springboot.plus/guide/rbac.html)
2226

2327
### 🔨 Dependency Upgrades
2428
- Upgrade to `spring-boot` 2.2.0.RELEASE
2529
- Upgrade to `spring-boot-admin` 2.2.0-SNAPSHOT
2630
- Upgrade to `lombok` 1.18.10
2731
- Upgrade to `hutool` 5.0.3
2832
- Upgrade to `mapstruct` 1.3.1.Final
33+
- Upgrade to `hutool` 5.0.4
2934

3035

3136
## [V1.3.1-RELEASE] 2019.10.15

CODE_OF_CONDUCT.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht
7575
For answers to common questions about this code of conduct, see
7676
https://www.contributor-covenant.org/faq
7777

78+

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Welcome pull request
22

3+

README-zh.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
10. 使用assembly maven插件进行不同环境打包部署,包含启动、重启命令,配置文件提取到外部config目录
4747

4848
## 项目架构
49-
![spring-boot-plus-architecture.jpg](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/spring-boot-plus-architecture.jpg)
49+
![spring-boot-plus-architecture.jpg](https://spring-boot-plus.gitee.io/img/spring-boot-plus-architecture.jpg)
5050

5151
### 项目环境
5252
中间件 | 版本 | 备注
@@ -285,7 +285,7 @@ public class SpringBootPlusApplication {
285285
[http://127.0.0.1:8888/swagger-ui.html](http://127.0.0.1:8888/swagger-ui.html)
286286

287287
### 5. 系统用户 增删改查分页Swagger
288-
![sys_user_swagger-zh.png](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/sys_user_swagger-zh.png)
288+
![sys_user_swagger-zh.png](https://spring-boot-plus.gitee.io/img/sys_user_swagger-zh.png)
289289

290290
## 快速开始
291291
[快速开始](https://springboot.plus/guide/quick-start.html)
@@ -298,7 +298,7 @@ public class SpringBootPlusApplication {
298298
> 安装 `jdk`, `git`, `maven`, `redis`, `mysql`
299299
300300
```bash
301-
wget -O download-install-all.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/download-install-all.sh
301+
wget -O download-install-all.sh https://springboot.plus/bin/download-install-all.sh
302302
```
303303

304304
### 2. 运行安装脚本
@@ -324,7 +324,7 @@ exit
324324
325325
### 5. 下载部署脚本 `deploy.sh`
326326
```bash
327-
wget -O deploy.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/deploy/deploy.sh
327+
wget -O deploy.sh https://springboot.plus/bin/deploy.sh
328328
```
329329
330330
### 6. 执行脚本
@@ -396,11 +396,11 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
396396
397397
398398
## 联系
399-
400399
- spring-boot-plus技术交流群
401400
402-
![spring-boot-plus QQ Group](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/spring-boot-plus-qq-group.png)
401+
![spring-boot-plus QQ Group](https://spring-boot-plus.gitee.io/img/spring-boot-plus-qq-group.png)
403402
404403
405404
## License
406405
spring-boot-plus is under the Apache 2.0 license. See the [LICENSE](https://github.com/geekidea/spring-boot-plus/blob/master/LICENSE) file for details.
406+

README.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
- Integrate maven-assembly-plugin for different environment package deployment, including startup and restart commands, and extract configuration files to external config directory
4949

5050
## Architecture
51-
![spring-boot-plus-architecture.jpg](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/spring-boot-plus-architecture.jpg)
51+
![spring-boot-plus-architecture.jpg](https://springboot.plus/img/spring-boot-plus-architecture.jpg)
5252

5353
### Project Environment
5454
Middleware | Version | Remark
@@ -284,7 +284,7 @@ public class SpringBootPlusApplication {
284284
[http://127.0.0.1:8888/swagger-ui.html](http://127.0.0.1:8888/swagger-ui.html)
285285

286286
### 5. SysUser CRUD Swagger
287-
![sys_user_swagger.png](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/sys_user_swagger.png)
287+
![sys_user_swagger.png](https://springboot.plus/img/sys_user_swagger.png)
288288

289289

290290
## Quick Start
@@ -300,7 +300,7 @@ public class SpringBootPlusApplication {
300300
> Install `jdk`, `git`, `maven`, `redis`, `mysql`
301301
302302
```bash
303-
wget -O download-install-all.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/bin/install/download-install-all.sh
303+
wget -O download-install-all.sh https://springboot.plus/bin/download-install-all.sh
304304
```
305305

306306
### 2. Run the installation script
@@ -326,7 +326,7 @@ exit
326326
327327
### 5. Download deployment script `deploy.sh`
328328
```bash
329-
wget -O deploy.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/deploy/deploy.sh
329+
wget -O deploy.sh https://springboot.plus/bin/deploy.sh
330330
```
331331
332332
### 6. Execution script
@@ -358,25 +358,25 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
358358
### [Spring Boot Admin Instances](http://47.105.159.10:8888/instances/e211ba082db8/details)
359359
<p>
360360
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
361-
<img src="https://springboot.plus/img/home/spring-boot-admin.png" alt="spring-boot-admin instances">
361+
<img src="https://springboot.plus/img/home/spring-boot-admin-en.png" alt="spring-boot-admin instances">
362362
</a>
363363
</p>
364364
365365
### [Spring Boot Admin Statistics](http://47.105.159.10:8888/instances/e211ba082db8/details)
366366
<p>
367367
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
368-
<img src="https://springboot.plus/img/home/spring-boot-admin-1.png" alt="spring-boot-admin statistics">
368+
<img src="https://springboot.plus/img/home/spring-boot-admin-1-en.png" alt="spring-boot-admin statistics">
369369
</a>
370370
</p>
371371
372372
### [Spring Boot Admin Log](http://47.105.159.10:8888/instances/e211ba082db8/logfile)
373373
<p>
374374
<a href="http://47.105.159.10:8888/instances/e211ba082db8/logfile">
375-
<img src="https://springboot.plus/img/home/spring-boot-admin-log.png" alt="spring-boot-admin log">
375+
<img src="https://springboot.plus/img/home/spring-boot-admin-log-en.png" alt="spring-boot-admin log">
376376
</a>
377377
</p>
378378
379-
### [spring-boot-plus Swagger文档](http://47.105.159.10:8888/swagger-ui.html)
379+
### [spring-boot-plus Swagger Docs](http://47.105.159.10:8888/swagger-ui.html)
380380
<p>
381381
<a href="http://47.105.159.10:8888/swagger-ui.html">
382382
<img src="https://springboot.plus/img/home/spring-boot-plus-swagger.png" alt="spring-boot-plus swagger docs">
@@ -397,5 +397,12 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
397397
- [CentOS Quick Build / Deploy / Launch Spring-boot-plus Project](https://www.bilibili.com/video/av67218970/)
398398
399399
400+
## Contact
401+
- spring-boot-plus QQ Group
402+
403+
![spring-boot-plus QQ Group](https://spring-boot-plus.gitee.io/img/spring-boot-plus-qq-group.png)
404+
405+
400406
## License
401407
spring-boot-plus is under the Apache 2.0 license. See the [LICENSE](https://github.com/geekidea/spring-boot-plus/blob/master/LICENSE) file for details.
408+

pom.xml

+14-1
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@
6464
<reflections.version>0.9.11</reflections.version>
6565
<jansi.version>1.18</jansi.version>
6666
<lombok.version>1.18.10</lombok.version>
67-
<hutool.version>5.0.3</hutool.version>
67+
<hutool.version>5.0.4</hutool.version>
6868
<junit.version>4.12</junit.version>
6969
<ini4j.version>0.5.4</ini4j.version>
7070
<mapstruct.version>1.3.1.Final</mapstruct.version>
7171
<shiro.version>1.4.1</shiro.version>
7272
<jwt.version>3.8.3</jwt.version>
73+
<guava.version>28.1-jre</guava.version>
7374

7475
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
7576
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
@@ -175,6 +176,12 @@
175176
<groupId>io.springfox</groupId>
176177
<artifactId>springfox-swagger2</artifactId>
177178
<version>${swagger2.version}</version>
179+
<exclusions>
180+
<exclusion>
181+
<groupId>com.google.guava</groupId>
182+
<artifactId>guava</artifactId>
183+
</exclusion>
184+
</exclusions>
178185
</dependency>
179186
<dependency>
180187
<groupId>io.springfox</groupId>
@@ -224,6 +231,12 @@
224231
<version>${reflections.version}</version>
225232
</dependency>
226233

234+
<dependency>
235+
<groupId>com.google.guava</groupId>
236+
<artifactId>guava</artifactId>
237+
<version>${guava.version}</version>
238+
</dependency>
239+
227240
<dependency>
228241
<groupId>org.fusesource.jansi</groupId>
229242
<artifactId>jansi</artifactId>

src/main/java/io/geekidea/springbootplus/common/constraints/EnumType.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.geekidea.springbootplus.common.constraints;
1818

19-
import io.geekidea.springbootplus.common.enums.BaseTypeStateEnum;
19+
import io.geekidea.springbootplus.common.enums.BaseEnum;
2020

2121
import javax.validation.Constraint;
2222
import javax.validation.Payload;
@@ -39,7 +39,7 @@
3939
public @interface EnumType {
4040
String message() default "请输入正确的类型值";
4141

42-
Class<? extends BaseTypeStateEnum> type();
42+
Class<? extends BaseEnum> type();
4343

4444
Class<?>[] groups() default { };
4545

src/main/java/io/geekidea/springbootplus/common/constraints/EnumTypeValidator.java

+18-17
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,36 @@
1616

1717
package io.geekidea.springbootplus.common.constraints;
1818

19-
import io.geekidea.springbootplus.common.enums.BaseTypeStateEnum;
19+
import io.geekidea.springbootplus.common.enums.BaseEnum;
2020
import io.geekidea.springbootplus.common.exception.BusinessException;
21-
import io.geekidea.springbootplus.util.EnumUtil;
21+
import io.geekidea.springbootplus.util.BaseEnumUtil;
2222

2323
import javax.validation.ConstraintValidator;
2424
import javax.validation.ConstraintValidatorContext;
2525

2626
/**
2727
* 自定义系统内的枚举验证注解实现类
28+
*
2829
* @author geekidea
2930
* @date 2018-11-08
3031
*/
3132
public class EnumTypeValidator implements ConstraintValidator<EnumType, Integer> {
3233

33-
private Class<? extends BaseTypeStateEnum> baseTypeStateEnum;
34+
private Class<? extends BaseEnum> baseEnum;
3435

35-
@Override
36-
public void initialize(EnumType parameters) {
37-
baseTypeStateEnum = parameters.type();
38-
if (baseTypeStateEnum == null){
39-
throw new BusinessException("请传入枚举类型类");
40-
}
41-
}
36+
@Override
37+
public void initialize(EnumType parameters) {
38+
baseEnum = parameters.type();
39+
if (baseEnum == null) {
40+
throw new BusinessException("请传入枚举类型类");
41+
}
42+
}
4243

43-
@Override
44-
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
45-
if (value ==null){
46-
return true;
47-
}
48-
return EnumUtil.exists(baseTypeStateEnum,value);
49-
}
44+
@Override
45+
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
46+
if (value == null) {
47+
return true;
48+
}
49+
return BaseEnumUtil.exists(baseEnum, value);
50+
}
5051
}

src/main/java/io/geekidea/springbootplus/common/controller/ApiDocController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
public class ApiDocController extends BaseController {
3636

3737
/**
38-
* swaggerUI
39-
*/
38+
* swaggerUI
39+
*/
4040
@GetMapping("")
41-
public String swaggerUI(){
41+
public String swaggerUI() {
4242
return "redirect:/swagger-ui.html";
4343
}
4444

src/main/java/io/geekidea/springbootplus/common/controller/BaseController.java

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public abstract class BaseController extends ApiController {
3939
public HttpServletRequest getRequest() {
4040
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
4141
}
42+
4243
/**
4344
* 获取当前请求
4445
*

0 commit comments

Comments
 (0)