GitPedia

Spring boot demo

Spring Boot & Spring Cloud & Spring Security Demo Case(Spring学习示例实战项目)

From liuyueyi·Updated June 16, 2026·View on GitHub·

> SpringBoot + SpringCloud + SpringSecurity学习过程中的源码汇总,沉淀记录下学习历程 The project is written primarily in Java, distributed under the Apache License 2.0 license, first published in 2018. Key topics include: aop, bean, influxdb, jdbctemplate, jpa.

Spring-Boot-Demo

<a href="https://spring.hhui.top" target="_blank"> <img src="https://img.shields.io/badge/-微信关注“一灰灰blog”公众号-orange.svg" alt="#" align="right"> </a>

Build Status
Average time to resolve an issue
Percentage of issues still open

SpringBoot + SpringCloud + SpringSecurity学习过程中的源码汇总,沉淀记录下学习历程

<bold style="color:red"> 说明:Spring系列教程现已根据专栏方式进行收集整理,更便于系统学习,详情查看: [一灰灰的Spring系列专栏](https://hhui.top/spring/)</bold>

欢迎关注公众号 一灰灰blog 更多干货持续分享

QrCode

0. 项目说明

如果想在本机使用这个项目的demo,下面有一些注意事项

环境要求

bash
java: jdk1.8 maven: 3.2+ spring boot: 2.2.1.RELEASE ide: IDEA/Eclipse/NetBeans随意 ## 不同项目的环境依赖,请以项目对应的博文要求为准 db: mongodb + mysql + redis + solr + elasticsearch 中间件: promotheus + grafana + kibana + rabbitmq

IDEA插件

bash
# 必须 lombok # 推荐 maven helper: 查看依赖树的好工具(排除依赖冲突非常棒) Free MyBatis plugin: mybatis的mapper与xml跳转比较方便 Mybatis log Plugin:日志 CodeGlance: 类似sublimetext 右边的快速预览框 Rainbow Brackets: 不同层级的括号颜色不一样

1. 知识点图谱

所有博文集中发布在个人博客网站 : 一灰灰Blog-Spring

大致规划的内容包括以下章节,希望能用<del>半年到一年(严重超期)</del>的时间完成....

I. 基础篇

II. 高级篇

III. MVC篇

IV. SpringCloud篇

  • 注册中心
  • 配置中心
  • 网关路由
  • 负载均衡
  • 熔断器
  • 链路监控
  • 安全模块
  • oauth
  • admin

V. 源码篇

VI. 项目说明

<details><summary> 项目说明 </summary>
项目说明知识点
SpringBootSpringBoot项目-
000-properties【配置】使用姿势@PropertySource 指定配置文件,<br/> @ConfigurationProperties 指定配置前缀, <br/>@value 配置绑定
001-properties【配置】环境选择配置spring.profiles.active指定环境
002-properties【配置】刷新示例SpringCloud生态配置刷新<br/>@RefreshScopeEnvironmentChangeEvent配置变更事件
002-properties-bind【配置】刷新绑定的各种知识点@ConfigurationProperties
002-dynamic-envronment【配置】自定义配置源MapPropertySource
002-properties-value【配置】@Value扩展知识点@Value
003-log【日志】集成logbacklogback日志集成与配置
003-log4j2【日志】集成log4j2log4j2日志集成与配置
004-bean【bean】使用姿势bean三种定义姿势 <br/> bean三种注入方式
005-autoconfig【bean】自动加载@Configuration自动加载配置类
005-config-selector【bean】选择注入ImportSelector 选择在接口的多个实现中,具体实例化哪个
006-dynamicbean【bean】动态注册beanBeanDefinitionRegistryPostProcessor 扩展实现bean动态注册
007-conditionbean【bean】条件注入@Coinditional 使用姿势
008-beanorder<br/>008-beanorder-addition<br/> 008-beanorder-addition2【bean】加载顺序bean加载顺序的反面示例与正确写法
009-schedule【定时器】定时任务/计划任务@Scheduled 基本语法与自定义线程池
010-aop【AOP】切面aop基本使用姿势与注意事项
011-aop-logaspect【AOP】切面实战,日志切面
012-context-listener【Listener】事件ContextListener
013-spel【SpEL】SpEL语法与实例
014-spel-aop【SpEL】SpEL & aop整合时注意事项
100-h2database【DB】h2database整合-
100-mysql【DB】mysql整合-
101-jdbctemplate【DB】jdbctemplate使用姿势 CURD详解JdbcTemplate
101-jdbctemplate-transaction【DB】事务@Transactional声明式; 编程式事务 <br/> - 隔离级别 <br/> 传递属性
102-jpa【DB】 jpa使用姿势JPA
102-jpa-errorcase【DB】环境配置易错点@EnableJpaRepositories, @EntityScan指定扫描包
102-jpa-errorcase2【DB】Entity映射错误Field映射POJO
103-mybatis-xml【DB】mybatis xml配置整合方式mybatis
104-mybatis-noxml【DB】mybatis 注解整合方式mybatis
105-mybatis-plus【DB】mybatis-plus整合mybatis-plus
106-mybatis-plus-generator【DB】mybatis-plus代码自动生成mybatis-plus
107-jooq-aop【DB】jooq体验demo,jooq+aop导致项目启动巨慢的坑jooq
108-jooq-curd【DB】jooq CURD使用姿势jooq
108-jooq-mysql【DB】jooq代码自动生成jooq-code-gen
109-multi-datasource【DB】多数据源配置JdbcTemplate, DataSource
109-multi-datasource-mybatis【DB】mybatis多数据源配置Mybatis DataSource
109-multi-datasource-mybatis-ano【DB】mybatis多数据源配置Mybatis DataSource
109-multi-datasource-mybatis-plus【DB】mybatis-plus多数据源配置Mybatis-Plus DataSource
110-mongo-basic【DB】mongodb整合mongodb
111-mongo-template【DB】mongodb CURD使用姿势MongoTemplate
120-redis-config【redis】环境配置与基本使用redis
121-redis-jedis-config【redis】jedis配置jedis
122-redis-template【redis】RedisTemplate 使用姿势详解RedisTemplate
123-redis-lettuce-config【redis】lettuce配置lettuce
124-redis-cluster【redis】集群使用姿势redis集群实例
125-cache-ano【Cache】缓存注解Spring缓存注解使用姿势
130-influxdb【DB】influxdb整合及CURD时序数据库 influxdb
131-influxdb-java【DB】influxdb封装封装更服务SpringBoot规范的InfluxTemplate,待实现
140-search-solr【Solr】solr环境+CURD使用姿势SolrTemplate, SolrClient
141-search-solr-auth【Solr】solr开启授权无法更新索引的四种解决方案解决solr更新索引报错问题
142-search-es【ES】es实例使用demoES,权限验证,CURD,高级特性等 RestHighLevelClient
150-i18n【i18n】国际化国际化支持
161-schema-init【DB】数据初始化数据初始化
162-liquibase【DB】LiquibaseLiquibase数据库版本管理
200-webflux【web】WebFlux实例React
201-web【web】basic http实例springmvc
202-web-params【web】请求参数解析的各种姿势get参数解析<br/>post参数解析<br/>自定义参数解析HandlerMethodArgumentResolver
202-web-params-validate【web】请求参数校验参数校验validation-api
203-websocket【web】websocket实例WebSocketHandler, WebSocketConfigurer
204-web-static-resources【web】静态资源访问实例WebMvcConfigure, spring.resources.static-locations
204-web-static-resources-ui【web】webjar静态资源第三方jar包提供纯静态资源
204-web-xml【web】xml传参与返回实例xml传参返回使用姿势
204-web-xml-json【web】自定义返回数据类型的几种方式返回xml,返回json,请求头、返回头,内容协商ContentNegotiationConfigurer
204-web-freemaker【web】freemaker引擎整合freemaker
205-web-thymeleaf【web】thymeleaf引擎整合thymeleaf
206-web-beetl【web】beetl引擎整合beetl
207-web-response【web】http响应的各种姿势基本数据返回 <br/> 重定向 <br/> 错误页面配置 <br/> 定制http code
207-web-res-gzip【web】返回结果压缩json/text/静态资源返回压缩
208-web-mapping【web】自定义url映射规则RequestCondition
209-web-error【web】全局异常处理ControllerAdvice, ExceptionHandler
210-web-filter【web】filter使用姿势HttpFilter过滤器
210-web-filter-order【web】filter优先级使用姿势HttpFilter, @Order
211-web-servlet【web】servlet使用姿势Servlet
212-web-listener【web】listener知识点Listener
219-web-asyn【web】异步请求AsyncContext方式 <br/> Callable <br/> WebAsyncTask <br/>DeferredResult
220-web-sse【web】sse 服务器发送事件SseEmitter
221-web-resttemplate【web】RestTemplate使用姿势RestTemplate
222-web-client【web】WebClient使用姿势WebClient
223-webflux-params【web】webflux参数解析实例demowebflux
230-web-resin【web】resion容器整合resin
300-rabbitmq【web】rabbitmq整合rabbitmq
301-rabbitmq-publish【web】rabbitmq发送消息RabbitTemplate <br/> 消息确认模式 <br/> 事务模式
302-rabbitmq-consumer【web】rabbitmq消费消息姿势@RabbitListener
400-docker-demo【docker】docker整合Dockerfile
410-zookeeper-basic【中间件】zk使用姿势ZooKeeper
411-zookeeper-distributelock【中间件】zk 分布式锁DistributeLock
420-prometheus-basic【中间件】Prometheus监控Prometheus
421-prometheus-micro【中间件】Prometheus监控Prometheus
430-email【中间件】email 邮件发送email
500-cache-caffeine【中间件】内存缓存CaffieneCaffiene
501-cache-caffeine-special【中间件】内存缓存CaffieneCaffiene
600-snowflake-id【DB】雪花算法Snowflake
601-actuator【监控】检测Actuator
SpringCase实战/应用演练项目-
000-spi-factorybean借助FactoryBean实现SPI效果FactoryBean
002-dynamic-config <br/> 002-dynamic-config-demo自定义配置加载与刷新示例工程借助InstantiationAwareBeanPostProcessorAdapter + Spring事件机制实现@Value @RefreshScope
006-importbean将非spring项目导入Spring生态 <br/> 自定义注入实例ImportBeanDefinitionRegistrar
008-bean-order<br/>008-bean-order-client指定bean加载优先级,让中间件的核心bean优于业务bean被加载InstantiationAwareBeanPostProcessorAdapter, @Import
009-distribute-scheduler-task分布式定时任务mock实例AOP实现定时任务选择; 重写ScheduledAnnotationBeanPostProcessor扩展定时任务生成
010-auto-inject自定义注入实现BeanPostProcessor 与 代理类创建
120-redis-ranklistredis实现排行榜zset
124-redis-sitecountredis实现站点统计redisTemplate
125-redis-distribuet-lockredis分布式锁redisTemplate
126-redis-delay-listredis实现的演示队列redisTemplate
201-web-api-versionweb版本控制RequestMappingHandlerMapping
202-web-qrcode-loginweb扫码登录实战SseEmitter
203-web-rest-adapterurl匹配规则自定义,子类继承父类的参数注解RequestMappingHandlerMapping, HandlerMethodArgumentResolver
204-web-request-proxy基于接口的REST访问支持ClassPathBeanDefinitionScanner, ImportBeanDefinitionRegistrar
205-web-rest-enhanced单机应用最小成本扩展REST服务示例RequestMappingHandlerMapping
421-prometheus-metricAOP实现自定义的Prometheus埋点上报Prometheus
430-mail-alarm基于日志的邮件报警javaMailSender
431-mail-report每天邮件上报统计报表实例javaMailSender
SpringSecurity安全
000-basic-demo整合实例
001-authentication-mem-config内存认证
001-authentication-mem-userdetail内存认证
002-authentication-dbdb认证
010-accesscontrol-rbacrbac 权限管理
011-accesscontrol-aclacl权限管理
spring-cloud微服务
config-server配置中心spring cloud config
eurka-server注册中心spring cloud eurka
eurka-service-consumer服务提供者spring cloud eurka
eurka-service-provider服务消费者ribbon feign
gateway网关spring cloud gateway 网关
spring-extentionSpring的扩展点
100-application-context-extend上下文刷新前扩展点ApplicationContextInitializerApplicationContextInitializer
101-bean-definition
102-bean-factory-post-processor
103-instantiation-bean-post-processor
104-smart-instantiation-bean-post-processor
105-bean-factory-aware
</details>

2. 系列博文

0. 实战系列

  1. 【SpringBoot实战】Bean之注销与动态注册实现服务mock
  2. 【SpringBoot实战】FactoryBean及代理实现SPI机制的实例
  3. 【SpringBoot实战】借助Redis实现排行榜功能
  4. 【SpringBoot实战】借助Redis搭建一个简单站点统计服务
  5. 【SpringBoot实战】AOP实现日志功能
  6. 【SpringBoot实战】徒手撸一个扫码登录示例工程
  7. 【SpringBoot实战】mock一个简单的分布式定时任务
  8. 【SpringBoot实战】Redis实现分布式锁(应用篇)
  9. 【SpringBoot实战】借助redis来实现延时队列(应用篇)

1. 基础系列

基础系列博文包括 AOP, IoC(DI,Bean), 日志, 自动配置等

配置

IoC(DI/bean)

AOP相关

日志

定时任务

SpEL

事件

国际化

2. DB系列

我们将db区分为传统的关系型数据库如mysql,NoSql如redis、mongodb,时序数据库influxdb

h2database

MongoDB

redis

mysql

分别介绍多种不同的操作姿势

JdbcTemplate

jpa

mybatis

事务

采坑、填坑

jooq

数据初始化

3. 搜索系列

搜索主要会区分solr和es

solr

es

4. MQ系列

消息队列,如rabbitmq, rocketmq, activemq, kafaka

rabbitmq

5. WEB系列

web系列的东西就比较多了,基本上日常开发中,你需要的都会有;你没用过的也会有

websocket

采坑、填坑

应用实战

WebFlux系列

由于WebFlux和SpringMVC在一些基础上差别较大,单独开一个系列教程版块

webclient异步网络请求

6. SpringSecurity系列

记录SpringSecurity相关的所有技术文章,分类汇总如下,持续更新中

简单抽象的说一下SpringSecurity它的定义

  • 很🐂的认证和访问权限校验框架

那么具体能干嘛?

  • 用户登录认证:用户名+密码登录,确定用户身份
  • 用户访问鉴权(常见的ACL访问控制列表,RBAC角色访问控制):判定是否有权限访问某个资源
  • 安全保护(CSRF跨站点攻击,Session Fixation会话固定攻击…)

相关博文

7. SpringCloud系列

微服务系列

Eureka系列

踩坑、填坑

8. 运维

docker

9. 中间件

zookeeper

prometheus

邮件

Caffiene缓存

10. 扩展点

3. 其他

拒绝单机,欢迎start或者加好友支持

待更新系列

[x] @Value支持绑定自定义的配置源,并支持动态刷新
[ ] 事务后置\前置\回滚操作
[ ] druid数据源配置相关
[ ] 多线程的事务支持
[ ] 扩展点系列
[ ] prometheus监控druid仙姑噶那配置向
[ ] websocket补齐
[ ] webflux配套教程

声明

尽信书则不如无书,以上内容,一家之言,因个人能力有限,难免有疏漏和错误之处,如发现bug或者有更好的建议,欢迎批评指正,不吝感激

  • 微博地址: 小灰灰Blog
  • QQ: 一灰灰/3302797840
  • WeChat: 一灰/liuyueyi25

扫描关注

公众号&博客

QrCode

打赏码

pay

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from liuyueyi/spring-boot-demo via the GitHub API.Last fetched: 6/29/2026