Spring Boot 项目架构

  前段时间本身整理了一份关于SpringBoot的项目文章,文中对SpringBoot的经常使用技术整合经过代码作了一个比较具体的入门展现,很高兴在本身学习的同时,可以帮助到你们.鉴于一些朋友想要源码,因而本身将文章中的代码实现进一步优化,提取成一个方便进行二次开发的脚手架项目,并辅以很是详细的说明注释,放在gitee上供你们直接学习使用,而后删除了此篇文章的代码示例,仅保留说明部分.java

  Gitee项目地址  ApiStarter ,你们先阅读readme.md说明,能够快速了解整个项目,也但愿你们可以提出本身的意见或建议.mysql

  本项目是一个Spring boot项目.先看一下官方对Spring Boot的定义nginx

Our primary goals are:git

  • Provide a radically faster and widely accessible getting started experience for all Spring development.
  • Be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults.
  • Provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration).
  • Absolutely no code generation and no requirement for XML configuration.

开箱即用,目标就是简化简化再简化开发,嗯,那咱们的目标也是咯.redis

1、nginx/zuul作LB eureka高可用作注册中心sql

2、先后分离经过JSON交互数据数据库

3、Controller层使用适配器缓存

4、Service层很常规mybatis

5、JWT作token验证app

6、AOP作请求记录

7、mybatis generator自动生成mapper、model、xml

8、Logback作日志记录

9、自定义javadoc doclet作接口描述文档

10、链接池使用dbcp2

11、redis缓存

12、WebMvcConfigurerAdapter拦截器

十3、LineRunner启动任务加载基础数据

十4、ApplicationListener监听器

十5、数据库使用mysql

十6、线程池用来执行task定时任务

十7、统一异常处理

看一下项目结构,让咱们有一个总体的了解:

相关文章
相关标签/搜索