太原企業(yè)做網(wǎng)站營銷團隊找產(chǎn)品合作
目錄
一、服務基礎配置
二、配置數(shù)據(jù)庫數(shù)據(jù)源
三、配置緩存
四、配置日志
五、配置統(tǒng)一異常處理
六、配置swagger文檔
七、配置用戶登錄模塊
八、配置websocket
九、配置定時任務
十、配置文件服務器
十一、配置Nacos
十二、配置項目啟動數(shù)據(jù)庫默認初始化(liquibase)
十三、配置Feign調(diào)用
十四、配置網(wǎng)關Spring-GateWay
十五、使用分布式鎖
以下教程需要有一定的編程基礎需要熟悉
Mysql、Redis、Spring boot、Mybatis等主流JAVA技術
一、服務基礎配置
server.port=8080
spring.application.name=demo
#請求返回時間格式定制
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=false
spring.jackson.locale=zh_CN
#上傳文件大小限制
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB
#開啟循環(huán)依賴
spring.main.allow-circular-references=true
#請求路徑與 Spring MVC 處理映射匹配的默認策略
spring.mvc.pathmatch.matching-strategy=path_pattern_parser
二、配置數(shù)據(jù)庫數(shù)據(jù)源
1.通過基礎方式配置數(shù)據(jù)源
Spring boot集成各種數(shù)據(jù)源操作數(shù)據(jù)庫
三、配置緩存
1.使用redis緩存
Spring boot 集成redis-CSDN博客
2.使用Guava Cache
3.使用內(nèi)存
四、配置日志
1.通過loback配置日志
spring boot集成loback日志配置-CSDN博客