Skip to content

Commit

Permalink
Merge pull request #8 from xkcoding/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Lilaccoral authored Apr 11, 2020
2 parents 2bcf49b + 9b9a24d commit deac657
Show file tree
Hide file tree
Showing 87 changed files with 3,414 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Created by .ignore support plugin (hsz.mobi)
### xkcoding-后端 template
### Spring Boot ###
/target/
target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
Expand Down Expand Up @@ -37,4 +37,4 @@ logs/
.DS_Store

### VS CODE ###
.vscode/
.vscode/
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ notifications:
cache:
directories:
- '$HOME/.m2/repository'

branches:
only:
- master
25 changes: 21 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

## Introduction

`spring boot demo` is a project for learning and practicing `spring boot`, including `65` demos, and `52` of them have been done.
`spring boot demo` is a project for learning and practicing `spring boot`, including `66` demos, and `54` of them have been done.

This project has integrated actuator (`monitoring`), admin (`visual monitoring`), logback (`log`), aopLog (`recording web request logs through AOP`), global exception handling (`json level and page level` ), freemarker (`template engine`), thymeleaf (`template engine`), Beetl (`template engine`), Enjoy (`template engine`), JdbcTemplate (`general JDBC operate database`), JPA (`powerful ORM framework `), mybatis (`powerful ORM framework`), Generic Mapper (`mybatis quick operation `), PageHelper (`powerful mybatis pagination plugin`), mybatis-plus (`mybatis quick operation`), BeetlSQL (`powerful ORM framework `), upload (`local file upload and qiniu cloud file upload`), redis (`cache`), ehcache (`cache`), email (`send various types of mail`), task (`basic scheduled tasks`), quartz (`dynamic management scheduled tasks`), xxl-job (`distributed scheduled tasks`), swagger (`API interface management and tests`), security (`RBAC-based Dynamic Rights Authentication`), SpringSession (`session sharing`), Zookeeper (`implement distributed locks by AOP`), RabbitMQ (`message queue`), Kafka (`message queue`), websocket (` server pushes the monitoring server status to front end `), socket.io (`chat room`), ureport2 (`Chinese-style report`), packaged into a `war` file, integrate ElasticSearch (`basic operations and advanced queries`), Async ( `asynchronous tasks`), integrated Dubbo (`with official starter`), MongoDB (`document database`), neo4j (`graph database`), docker (`container`), `JPA Multi-Datasource`, `Mybatis Multi-Datasource`, `code generator`', GrayLog (`log collection`), JustAuth (`third-party login`), LDAP(`CURD`), `Dynamically add/switch datasources`, Standalone RateLimiting(`AOP + Guava RateLimiter`), Distributed Ratelimiting(`AOP + Redis + Lua`), ElasticSearch 7.x(`use official Rest High Level Client`).
This project has integrated actuator (`monitoring`), admin (`visual monitoring`), logback (`log`), aopLog (`recording web request logs through AOP`), global exception handling (`json level and page level` ), freemarker (`template engine`), thymeleaf (`template engine`), Beetl (`template engine`), Enjoy (`template engine`), JdbcTemplate (`general JDBC operate database`), JPA (`powerful ORM framework `), mybatis (`powerful ORM framework`), Generic Mapper (`mybatis quick operation `), PageHelper (`powerful mybatis pagination plugin`), mybatis-plus (`mybatis quick operation`), BeetlSQL (`powerful ORM framework `), upload (`local file upload and qiniu cloud file upload`), redis (`cache`), ehcache (`cache`), email (`send various types of mail`), task (`basic scheduled tasks`), quartz (`dynamic management scheduled tasks`), xxl-job (`distributed scheduled tasks`), swagger (`API interface management and tests`), security (`RBAC-based Dynamic Rights Authentication`), SpringSession (`session sharing`), Zookeeper (`implement distributed locks by AOP`), RabbitMQ (`message queue`), Kafka (`message queue`), websocket (` server pushes the monitoring server status to front end `), socket.io (`chat room`), ureport2 (`Chinese-style report`), packaged into a `war` file, integrate ElasticSearch (`basic operations and advanced queries`), Async ( `asynchronous tasks`), integrated Dubbo (`with official starter`), MongoDB (`document database`), neo4j (`graph database`), docker (`container`), `JPA Multi-Datasource`, `Mybatis Multi-Datasource`, `code generator`', GrayLog (`log collection`), JustAuth (`third-party login`), LDAP(`CURD`), `Dynamically add/switch datasources`, Standalone RateLimiting(`AOP + Guava RateLimiter`), Distributed Ratelimiting(`AOP + Redis + Lua`), ElasticSearch 7.x(`use official Rest High Level Client`), HTTPS, Flyway(`initialize databases`).

> If you have demos to contribute or needs to meet, it is very welcome to submit a [issue](https://github.com/xkcoding/spring-boot-demo/issues/new) and I will add it to my [TODO](./TODO.en.md) list.
Expand Down Expand Up @@ -123,8 +123,9 @@ View the [TODO](./TODO.en.md) file
| [spring-boot-demo-dynamic-datasource](./spring-boot-demo-dynamic-datasource) | a demo to add datasource dynamically, switch datasource dynamically. |
| [spring-boot-demo-ratelimit-guava](./spring-boot-demo-ratelimit-guava) | a demo to use use Guava RateLimiter to protect API by standalone rate limiting. |
| [spring-boot-demo-ratelimit-redis](./spring-boot-demo-ratelimit-redis) | a demo to use Redis and Lua script implementation to protect API by distributed rate limiting. |
| spring-boot-demo-https | <span style="color:pink;">NOT FINISHED YET!</span> <br />a demo to integrate HTTPS. |
| [spring-boot-demo-https](./spring-boot-demo-https) | a demo to integrate HTTPS. |
| [spring-boot-demo-elasticsearch-rest-high-level-client](./spring-boot-demo-elasticsearch-rest-high-level-client) | a demo to integrate ElasticSearch 7.x version by using official Rest High Level Client to operate ES data. |
| [spring-boot-demo-flyway](./spring-boot-flyway) | a demo to integrate Flyway to initialize tables and data in database, Flyway also support the sql script version control. |

## License

Expand Down Expand Up @@ -210,6 +211,8 @@ Copyright (c) 2018 Yangkai.Shen
<module>spring-boot-demo-ratelimit-guava</module>
<module>spring-boot-demo-ratelimit-redis</module>
<module>spring-boot-demo-elasticsearch-rest-high-level-client</module>
<module>spring-boot-demo-https</module>
<module>spring-boot-demo-flyway</module>
</modules>
<packaging>pom</packaging>

Expand All @@ -224,11 +227,25 @@ Copyright (c) 2018 Yangkai.Shen
<maven.compiler.target>1.8</maven.compiler.target>
<spring.boot.version>2.1.0.RELEASE</spring.boot.version>
<mysql.version>8.0.12</mysql.version>
<hutool.version>4.6.6</hutool.version>
<hutool.version>5.0.0</hutool.version>
<guava.version>28.1-jre</guava.version>
<user.agent.version>1.20</user.agent.version>
</properties>

<repositories>
<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

## 项目简介

`spring boot demo` 是一个用来深度学习并实战 `spring boot` 的项目,目前总共包含 **`65`** 个集成demo,已经完成 **`52`** 个。
`spring boot demo` 是一个用来深度学习并实战 `spring boot` 的项目,目前总共包含 **`66`** 个集成demo,已经完成 **`54`** 个。

该项目已成功集成 actuator(`监控`)、admin(`可视化监控`)、logback(`日志`)、aopLog(`通过AOP记录web请求日志`)、统一异常处理(`json级别和页面级别`)、freemarker(`模板引擎`)、thymeleaf(`模板引擎`)、Beetl(`模板引擎`)、Enjoy(`模板引擎`)、JdbcTemplate(`通用JDBC操作数据库`)、JPA(`强大的ORM框架`)、mybatis(`强大的ORM框架`)、通用Mapper(`快速操作Mybatis`)、PageHelper(`通用的Mybatis分页插件`)、mybatis-plus(`快速操作Mybatis`)、BeetlSQL(`强大的ORM框架`)、upload(`本地文件上传和七牛云文件上传`)、redis(`缓存`)、ehcache(`缓存`)、email(`发送各种类型邮件`)、task(`基础定时任务`)、quartz(`动态管理定时任务`)、xxl-job(`分布式定时任务`)、swagger(`API接口管理测试`)、security(`基于RBAC的动态权限认证`)、SpringSession(`Session共享`)、Zookeeper(`结合AOP实现分布式锁`)、RabbitMQ(`消息队列`)、Kafka(`消息队列`)、websocket(`服务端推送监控服务器运行信息`)、socket.io(`聊天室`)、ureport2(`中国式报表`)、打包成`war`文件、集成 ElasticSearch(`基本操作和高级查询`)、Async(`异步任务`)、集成Dubbo(`采用官方的starter`)、MongoDB(`文档数据库`)、neo4j(`图数据库`)、docker(`容器化`)、`JPA多数据源`、`Mybatis多数据源`、`代码生成器`、GrayLog(`日志收集`)、JustAuth(`第三方登录`)、LDAP(`增删改查`)、`动态添加/切换数据源`、单机限流(`AOP + Guava RateLimiter`)、分布式限流(`AOP + Redis + Lua`)、ElasticSearch 7.x(`使用官方 Rest High Level Client`)。
该项目已成功集成 actuator(`监控`)、admin(`可视化监控`)、logback(`日志`)、aopLog(`通过AOP记录web请求日志`)、统一异常处理(`json级别和页面级别`)、freemarker(`模板引擎`)、thymeleaf(`模板引擎`)、Beetl(`模板引擎`)、Enjoy(`模板引擎`)、JdbcTemplate(`通用JDBC操作数据库`)、JPA(`强大的ORM框架`)、mybatis(`强大的ORM框架`)、通用Mapper(`快速操作Mybatis`)、PageHelper(`通用的Mybatis分页插件`)、mybatis-plus(`快速操作Mybatis`)、BeetlSQL(`强大的ORM框架`)、upload(`本地文件上传和七牛云文件上传`)、redis(`缓存`)、ehcache(`缓存`)、email(`发送各种类型邮件`)、task(`基础定时任务`)、quartz(`动态管理定时任务`)、xxl-job(`分布式定时任务`)、swagger(`API接口管理测试`)、security(`基于RBAC的动态权限认证`)、SpringSession(`Session共享`)、Zookeeper(`结合AOP实现分布式锁`)、RabbitMQ(`消息队列`)、Kafka(`消息队列`)、websocket(`服务端推送监控服务器运行信息`)、socket.io(`聊天室`)、ureport2(`中国式报表`)、打包成`war`文件、集成 ElasticSearch(`基本操作和高级查询`)、Async(`异步任务`)、集成Dubbo(`采用官方的starter`)、MongoDB(`文档数据库`)、neo4j(`图数据库`)、docker(`容器化`)、`JPA多数据源`、`Mybatis多数据源`、`代码生成器`、GrayLog(`日志收集`)、JustAuth(`第三方登录`)、LDAP(`增删改查`)、`动态添加/切换数据源`、单机限流(`AOP + Guava RateLimiter`)、分布式限流(`AOP + Redis + Lua`)、ElasticSearch 7.x(`使用官方 Rest High Level Client`)、HTTPS、Flyway(`数据库初始化`)

> 如果大家还有想要集成的demo,也可在 [issue](https://github.com/xkcoding/spring-boot-demo/issues/new) 里提需求。我会额外添加在 [TODO](./TODO.md) 列表里。✊
Expand Down Expand Up @@ -123,8 +123,9 @@
| [spring-boot-demo-dynamic-datasource](./spring-boot-demo-dynamic-datasource) | spring-boot 动态添加数据源、动态切换数据源 |
| [spring-boot-demo-ratelimit-guava](./spring-boot-demo-ratelimit-guava) | spring-boot 使用 Guava RateLimiter 实现单机版限流,保护 API |
| [spring-boot-demo-ratelimit-redis](./spring-boot-demo-ratelimit-redis) | spring-boot 使用 Redis + Lua 脚本实现分布式限流,保护 API |
| spring-boot-demo-https | spring-boot 集成 HTTPS <br /><span style="color:pink;">待完成</span> |
| [spring-boot-demo-https](./spring-boot-demo-https) | spring-boot 集成 HTTPS |
| [spring-boot-demo-elasticsearch-rest-high-level-client](./spring-boot-demo-elasticsearch-rest-high-level-client) | spring boot 集成 ElasticSearch 7.x 版本,使用官方 Rest High Level Client 操作 ES 数据 |
| [spring-boot-demo-flyway](./spring-boot-demo-flyway) | spring boot 集成 Flyway,项目启动时初始化数据库表结构,同时支持数据库脚本版本控制 |

## License

Expand Down Expand Up @@ -210,6 +211,8 @@ Copyright (c) 2018 Yangkai.Shen
<module>spring-boot-demo-ratelimit-guava</module>
<module>spring-boot-demo-ratelimit-redis</module>
<module>spring-boot-demo-elasticsearch-rest-high-level-client</module>
<module>spring-boot-demo-https</module>
<module>spring-boot-demo-flyway</module>
</modules>
<packaging>pom</packaging>

Expand All @@ -224,11 +227,25 @@ Copyright (c) 2018 Yangkai.Shen
<maven.compiler.target>1.8</maven.compiler.target>
<spring.boot.version>2.1.0.RELEASE</spring.boot.version>
<mysql.version>8.0.12</mysql.version>
<hutool.version>4.6.6</hutool.version>
<hutool.version>5.0.0</hutool.version>
<guava.version>28.1-jre</guava.version>
<user.agent.version>1.20</user.agent.version>
</properties>

<repositories>
<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
5 changes: 3 additions & 2 deletions TODO.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spring-boot-demo Project TODO List

## Module plan (completed: 52 / 65)
## Module plan (completed: 54 / 66)

- [x] ~~spring-boot-demo-helloworld(helloworld example)~~
- [x] ~~spring-boot-demo-properties (read configuration file information)~~
Expand Down Expand Up @@ -63,10 +63,11 @@
- [x] ~~spring-boot-demo-dynamic-datasource(add datasource dynamically, switch datasource dynamically)~~
- [x] ~~spring-boot-demo-ratelimit-guava(use Guava RateLimiter to protect API by standalone rate limiting)~~
- [x] ~~spring-boot-demo-ratelimit-redis(use Redis and Lua script implementation to protect API by distributed rate limiting)~~
- [ ] spring-boot-demo-https(integrated HTTPS)
- [x] ~~spring-boot-demo-https(integrated HTTPS)~~
- [x] ~~spring-boot-demo-elasticsearch-rest-high-level-client(integrated Elasticsearch 7.x version,use official Rest High Level Client to operate ES data)~~
- [ ] spring-boot-demo-springbatch(data process)
- [ ] spring-boot-demo-security-justauth(use JustAuth to login GitHub,and use Spring-Security to manage login state)
- [x] ~~spring-boot-demo-flyway(integrated Flyway to initialize tables and data in database, Flyway also support the sql script version control)~~

## Remarks

Expand Down
5 changes: 3 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# spring-boot-demo 项目待办列表

## 模块计划(已完成:52 / 65)
## 模块计划(已完成:54 / 66)

- [x] ~~spring-boot-demo-helloworld(Helloworld 示例)~~
- [x] ~~spring-boot-demo-properties(读取配置文件信息)~~
Expand Down Expand Up @@ -63,10 +63,11 @@
- [x] ~~spring-boot-demo-dynamic-datasource(动态添加数据源,切换数据源)~~
- [x] ~~spring-boot-demo-ratelimit-guava(单机限流保护API,集成 Guava 的 RateLimiter)~~
- [x] ~~spring-boot-demo-ratelimit-redis(分布式限流保护API,使用 Redis + lua 脚本实现)~~
- [ ] spring-boot-demo-https(集成 HTTPS)
- [x] ~~spring-boot-demo-https(集成 HTTPS)~~
- [x] ~~spring-boot-demo-elasticsearch-rest-high-level-client(集成 Elasticsearch 7.x 版本,使用官方 rest high level client操作 ES 数据)~~
- [ ] spring-boot-demo-springbatch(数据处理)
- [ ] spring-boot-demo-security-justauth(使用 JustAuth 登录 GitHub,使用 Security 管理登录状态)
- [x] ~~spring-boot-demo-flyway(集成 Flyway,项目启动时初始化数据库表结构,同时支持数据库脚本版本控制)~~

## 备注

Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
<module>spring-boot-demo-ratelimit-guava</module>
<module>spring-boot-demo-ratelimit-redis</module>
<module>spring-boot-demo-elasticsearch-rest-high-level-client</module>
<module>spring-boot-demo-https</module>
<module>spring-boot-demo-flyway</module>
</modules>
<packaging>pom</packaging>

Expand All @@ -86,6 +88,20 @@
<user.agent.version>1.20</user.agent.version>
</properties>

<repositories>
<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
29 changes: 29 additions & 0 deletions spring-boot-demo-flyway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
HELP.md
/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
/build/

### VS Code ###
.vscode/
Loading

0 comments on commit deac657

Please sign in to comment.