Skip to content
Merged

Dev #24

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target/
/classes
!.mvn/wrapper/maven-wrapper.jar

### STS ###
Expand Down
77 changes: 61 additions & 16 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,20 @@
</a>
</p>


#### SpringBoot Scaffolding

### spring-boot-plus是一套集成spring boot常用开发组件的后台快速开发框架
> Spring-Boot-Plus是易于使用,快速,高效,功能丰富,开源的spring boot 脚手架.

## Purpose
## 目标
> 每个人都可以独立、快速、高效地开发项目!

> Everyone can develop projects independently, quickly and efficiently!
## 文档
#### [GITHUB](https://github.com/geekidea/spring-boot-plus) | [GITEE](https://gitee.com/geekidea/spring-boot-plus)

## Quick Start
#### 官网地址:[springboot.plus](http://springboot.plus "springboot.plus")
#### GITHUB:[https://github.com/geekidea/spring-boot-plus](https://github.com/geekidea/spring-boot-plus "spring-boot-plus github")
#### GITEE:[https://gitee.com/geekidea/spring-boot-plus](https://gitee.com/geekidea/spring-boot-plus "spring-boot-plus gitee")
#### Website:[springboot.plus](http://springboot.plus "springboot.plus")

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


### 主要特性
1. 集成spring boot 常用开发组件集、公共配置、AOP日志等
2. 集成mybatis plus快速dao操作
Expand Down Expand Up @@ -79,8 +74,58 @@ jwt | 0.9.1 | json web token |
hutool-all | 4.5.10 | 常用工具集 |


## spring-boot-plus QQ技术交流群
![spring-boot-plus QQ技术交流群](https://raw.githubusercontent.com/geekidea/spring-boot-plus/master/docs/img/spring-boot-plus-qq-group.png)


#### 官网地址:[springboot.plus](http://springboot.plus "springboot.plus")
## 使用
### 克隆 spring-boot-plus
```bash
git clone https://github.com/geekidea/spring-boot-plus.git
cd spring-boot-plus
```

### Maven 构建
> 默认使用local环境,对应配置文件:application-local.yml

```bash
mvn clean package -Plocal
```

### 项目入口类
```java
/**
* spring-boot-plus 项目启动入口
* @author geekidea
* @since 2018-11-08
*/
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableAdminServer
@MapperScan({"io.geekidea.springbootplus.**.mapper"})
@SpringBootApplication
public class SpringBootPlusApplication {

public static void main(String[] args) {
// 启动spring-boot-plus
ConfigurableApplicationContext context = SpringApplication.run(SpringBootPlusApplication.class, args);
// 打印项目信息
PrintApplicationInfo.print(context);
}

}
```

## 快速开始
[快速开始](https://springboot.plus/guide/quick-start.html)

## 详细文档
[https://springboot.plus](https://springboot.plus)

## 联系
- Gmail: [springbootplus@gmail.com](mailto:springbootplus@gmail.com)
- 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)


## 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.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
## Purpose
> Everyone can develop projects independently, quickly and efficiently!

## DOCS
## Docs
#### [GITHUB](https://github.com/geekidea/spring-boot-plus) | [GITEE](https://gitee.com/geekidea/spring-boot-plus)

#### Website:[springboot.plus](http://springboot.plus "springboot.plus")
Expand Down Expand Up @@ -88,6 +88,32 @@ cd spring-boot-plus
mvn clean package -Plocal
```

### Project Main Class
```java
/**
* spring-boot-plus Project Main Class
* @author geekidea
* @since 2018-11-08
*/
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableAdminServer
@MapperScan({"io.geekidea.springbootplus.**.mapper"})
@SpringBootApplication
public class SpringBootPlusApplication {

public static void main(String[] args) {
// Run spring-boot-plus
ConfigurableApplicationContext context = SpringApplication.run(SpringBootPlusApplication.class, args);
// Print Project Info
PrintApplicationInfo.print(context);
}

}
```

## Quick Start
[Quick Start](https://springboot.plus/guide/quick-start.html)

Expand Down
14 changes: 6 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>io.geekidea</groupId>
<artifactId>spring-boot-plus</artifactId>
<version>1.2.1.RELEASE</version>
<version>1.2.2.RELEASE</version>
<packaging>jar</packaging>

<name>spring-boot-plus</name>
Expand Down Expand Up @@ -56,7 +56,6 @@
<druid.version>1.1.18</druid.version>
<commons-io.version>2.6</commons-io.version>
<reflections.version>0.9.11</reflections.version>
<hibernate-validator.version>6.0.17.Final</hibernate-validator.version>
<commons-codec.version>1.12</commons-codec.version>
<commons-net.version>3.6</commons-net.version>
<jansi.version>1.18</jansi.version>
Expand Down Expand Up @@ -108,6 +107,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down Expand Up @@ -212,12 +216,6 @@
<version>${reflections.version}</version>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.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 @@ -47,6 +47,10 @@ public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(SpringBootPlusApplication.class, args);
// 打印项目信息
PrintApplicationInfo.print(context);
/**
* TODO 日志现实行号
* 拦截器配置是否启用,参照文件上传拦截器
*/
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ public class RequestPathFilter implements Filter {
private static List<String> excludes = new ArrayList<>();

static {
excludes.add("/api");
excludes.add("/health/");
// 控制台日志忽略spring boot admin访问路径
excludes.add("/actuator");
excludes.add("/instances");
excludes.add("/logfile");
excludes.add("/sba-settings.js");
excludes.add("/assets/img/favicon.png");
}

@Override
Expand All @@ -50,6 +53,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
HttpServletRequest req = (HttpServletRequest) request;
String path = req.getServletPath();
String url = req.getRequestURL().toString();

boolean isOut = true;
for (String p : excludes){
if (path.startsWith(p)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class PermissionInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
log.info(request.getRequestURI());
log.info("\n\nPermissionInterceptor...\n\n");
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.geekidea.springbootplus.config.core;
package io.geekidea.springbootplus.core;

import io.geekidea.springbootplus.common.aop.LogAop;
import io.geekidea.springbootplus.common.web.interceptor.DownloadInterceptor;
import io.geekidea.springbootplus.common.web.interceptor.PermissionInterceptor;
import io.geekidea.springbootplus.common.web.interceptor.ResourceInterceptor;
import io.geekidea.springbootplus.common.web.interceptor.TokenTimeoutInterceptor;
import io.geekidea.springbootplus.common.web.interceptor.*;
import io.geekidea.springbootplus.resource.web.interceptor.DownloadInterceptor;
import io.geekidea.springbootplus.resource.web.interceptor.ResourceInterceptor;
import io.geekidea.springbootplus.resource.web.interceptor.UploadInterceptor;
import io.geekidea.springbootplus.security.interceptor.JwtInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Expand Down Expand Up @@ -81,6 +81,16 @@ public TokenTimeoutInterceptor tokenTimeoutInterceptor(){
return tokenTimeoutInterceptor;
}

/**
* 上传拦截器
* @return
*/
@Bean
public UploadInterceptor uploadInterceptor(){
UploadInterceptor uploadInterceptor = new UploadInterceptor();
return uploadInterceptor;
}

/**
* 资源拦截器
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.geekidea.springbootplus.config.core;
package io.geekidea.springbootplus.core;

import lombok.Data;
import lombok.experimental.Accessors;
Expand Down Expand Up @@ -50,6 +50,11 @@ public class SpringBootPlusInterceptorConfig implements Serializable {
*/
private InterceptorConfig resourceConfig;

/**
* 上传拦截器
*/
private InterceptorConfig uploadConfig;

/**
* 下载拦截器
*/
Expand All @@ -58,6 +63,11 @@ public class SpringBootPlusInterceptorConfig implements Serializable {
@Data
public static class InterceptorConfig {

/**
* 是否启用
*/
private boolean enabled;

/**
* 排除路径
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.geekidea.springbootplus.config.core;
package io.geekidea.springbootplus.core;

import lombok.Data;
import lombok.experimental.Accessors;
Expand Down Expand Up @@ -60,7 +60,6 @@ public class SpringBootPlusProperties {
@NestedConfigurationProperty
private SpringBootPlusInterceptorConfig interceptorConfig;


/**
* 上传目录
*/
Expand Down
Loading