Spring Boot 项目架构

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

  Gitee项目地址  Slavic ,大家先阅读readme.md说明,可以快速了解整个项目,也希望大家能够提出自己的意见或建议.

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

Our primary goals are:

  • 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.

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

一、nginx/zuul做LB eureka高可用做注册中心

二、前后分离通过JSON交互数据

三、Controller层使用适配器

四、Service层很常规

五、JWT做token验证

六、AOP做请求记录

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

八、Logback做日志记录

九、自定义javadoc doclet做接口描述文档

十、连接池使用dbcp2

十一、redis缓存

十二、WebMvcConfigurerAdapter拦截器

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

十四、ApplicationListener监听器

十五、数据库使用mysql

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

十七、统一异常处理

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

原文地址:https://www.cnblogs.com/loginloading/p/7599729.html