Skip to content

Commit

Permalink
Merge pull request #97 from geekidea/dev
Browse files Browse the repository at this point in the history
spring-boot-plus V1.4.0发布 集成用户角色权限部门管理
  • Loading branch information
springboot-plus authored Nov 4, 2019
2 parents cca307b + 63543b9 commit 20c060c
Show file tree
Hide file tree
Showing 28 changed files with 410 additions and 157 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ logs

*.rdb



7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@
- 自定义是否启用Shiro权限拦截
- 优化LogAop配置
- 代码生成模板优化,三种生成策略
- 自定义生成Shiro `RequiresPermissions`注解
- `Jackson`工具类,按字段顺序格式化输出
- `BaseEnum` 枚举父接口,`EnumController`,`BaseEnumUtil`, `EnumTypeValidator` 校验/获取枚举信息

### 🐞 Bug Fixes
- fix #81 刷新token问题
- fix #81 刷新token问题
- fix 获取角色token问题
- fix refreshToken方法和LoginUtil工具类方法问题

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

### 🔨 Dependency Upgrades
- Upgrade to `spring-boot` 2.2.0.RELEASE
- Upgrade to `spring-boot-admin` 2.2.0-SNAPSHOT
- Upgrade to `lombok` 1.18.10
- Upgrade to `hutool` 5.0.3
- Upgrade to `mapstruct` 1.3.1.Final
- Upgrade to `hutool` 5.0.4


## [V1.3.1-RELEASE] 2019.10.15
Expand Down
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq


1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Welcome pull request


12 changes: 6 additions & 6 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
10. 使用assembly maven插件进行不同环境打包部署,包含启动、重启命令,配置文件提取到外部config目录

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

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

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

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

### 2. 运行安装脚本
Expand All @@ -324,7 +324,7 @@ exit
### 5. 下载部署脚本 `deploy.sh`
```bash
wget -O deploy.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/deploy/deploy.sh
wget -O deploy.sh https://springboot.plus/bin/deploy.sh
```
### 6. 执行脚本
Expand Down Expand Up @@ -396,11 +396,11 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
## 联系
- Email: [[email protected]](mailto:[email protected])
- spring-boot-plus技术交流群
![spring-boot-plus QQ Group](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/spring-boot-plus-qq-group.png)
![spring-boot-plus QQ Group](https://spring-boot-plus.gitee.io/img/spring-boot-plus-qq-group.png)
## License
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.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
- Integrate maven-assembly-plugin for different environment package deployment, including startup and restart commands, and extract configuration files to external config directory

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

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

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


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

### 2. Run the installation script
Expand All @@ -326,7 +326,7 @@ exit
### 5. Download deployment script `deploy.sh`
```bash
wget -O deploy.sh https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/deploy/deploy.sh
wget -O deploy.sh https://springboot.plus/bin/deploy.sh
```
### 6. Execution script
Expand Down Expand Up @@ -358,25 +358,25 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
### [Spring Boot Admin Instances](http://47.105.159.10:8888/instances/e211ba082db8/details)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
<img src="https://springboot.plus/img/home/spring-boot-admin.png" alt="spring-boot-admin instances">
<img src="https://springboot.plus/img/home/spring-boot-admin-en.png" alt="spring-boot-admin instances">
</a>
</p>
### [Spring Boot Admin Statistics](http://47.105.159.10:8888/instances/e211ba082db8/details)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/details">
<img src="https://springboot.plus/img/home/spring-boot-admin-1.png" alt="spring-boot-admin statistics">
<img src="https://springboot.plus/img/home/spring-boot-admin-1-en.png" alt="spring-boot-admin statistics">
</a>
</p>
### [Spring Boot Admin Log](http://47.105.159.10:8888/instances/e211ba082db8/logfile)
<p>
<a href="http://47.105.159.10:8888/instances/e211ba082db8/logfile">
<img src="https://springboot.plus/img/home/spring-boot-admin-log.png" alt="spring-boot-admin log">
<img src="https://springboot.plus/img/home/spring-boot-admin-log-en.png" alt="spring-boot-admin log">
</a>
</p>
### [spring-boot-plus Swagger文档](http://47.105.159.10:8888/swagger-ui.html)
### [spring-boot-plus Swagger Docs](http://47.105.159.10:8888/swagger-ui.html)
<p>
<a href="http://47.105.159.10:8888/swagger-ui.html">
<img src="https://springboot.plus/img/home/spring-boot-plus-swagger.png" alt="spring-boot-plus swagger docs">
Expand All @@ -397,5 +397,12 @@ tail -f -n 1000 /root/spring-boot-plus-server/logs/spring-boot-plus.log
- [CentOS Quick Build / Deploy / Launch Spring-boot-plus Project](https://www.bilibili.com/video/av67218970/)
## Contact
- spring-boot-plus QQ Group
![spring-boot-plus QQ Group](https://spring-boot-plus.gitee.io/img/spring-boot-plus-qq-group.png)
## License
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.
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@
<reflections.version>0.9.11</reflections.version>
<jansi.version>1.18</jansi.version>
<lombok.version>1.18.10</lombok.version>
<hutool.version>5.0.3</hutool.version>
<hutool.version>5.0.4</hutool.version>
<junit.version>4.12</junit.version>
<ini4j.version>0.5.4</ini4j.version>
<mapstruct.version>1.3.1.Final</mapstruct.version>
<shiro.version>1.4.1</shiro.version>
<jwt.version>3.8.3</jwt.version>
<guava.version>28.1-jre</guava.version>

<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
Expand Down Expand Up @@ -175,6 +176,12 @@
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
Expand Down Expand Up @@ -224,6 +231,12 @@
<version>${reflections.version}</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.geekidea.springbootplus.common.constraints;

import io.geekidea.springbootplus.common.enums.BaseTypeStateEnum;
import io.geekidea.springbootplus.common.enums.BaseEnum;

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

Class<? extends BaseTypeStateEnum> type();
Class<? extends BaseEnum> type();

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,36 @@

package io.geekidea.springbootplus.common.constraints;

import io.geekidea.springbootplus.common.enums.BaseTypeStateEnum;
import io.geekidea.springbootplus.common.enums.BaseEnum;
import io.geekidea.springbootplus.common.exception.BusinessException;
import io.geekidea.springbootplus.util.EnumUtil;
import io.geekidea.springbootplus.util.BaseEnumUtil;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

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

private Class<? extends BaseTypeStateEnum> baseTypeStateEnum;
private Class<? extends BaseEnum> baseEnum;

@Override
public void initialize(EnumType parameters) {
baseTypeStateEnum = parameters.type();
if (baseTypeStateEnum == null){
throw new BusinessException("请传入枚举类型类");
}
}
@Override
public void initialize(EnumType parameters) {
baseEnum = parameters.type();
if (baseEnum == null) {
throw new BusinessException("请传入枚举类型类");
}
}

@Override
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
if (value ==null){
return true;
}
return EnumUtil.exists(baseTypeStateEnum,value);
}
@Override
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
if (value == null) {
return true;
}
return BaseEnumUtil.exists(baseEnum, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
public class ApiDocController extends BaseController {

/**
* swaggerUI
*/
* swaggerUI
*/
@GetMapping("")
public String swaggerUI(){
public String swaggerUI() {
return "redirect:/swagger-ui.html";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public abstract class BaseController extends ApiController {
public HttpServletRequest getRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}

/**
* 获取当前请求
*
Expand Down
Loading

0 comments on commit 20c060c

Please sign in to comment.