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、統一異常處理

看一下項目結構,讓咱們有一個總體的瞭解:

相關文章
相關標籤/搜索