{"id":8677,"date":"2023-11-28T20:34:43","date_gmt":"2023-11-28T12:34:43","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=8677"},"modified":"2023-12-06T11:00:02","modified_gmt":"2023-12-06T03:00:02","slug":"springboot-ti-gong-le-na-xie-he-xin-gong-neng","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/11\/28\/springboot-ti-gong-le-na-xie-he-xin-gong-neng\/","title":{"rendered":"SpringBoot\u63d0\u4f9b\u4e86\u54ea\u4e9b\u6838\u5fc3\u529f\u80fd\uff1f"},"content":{"rendered":"<p>Spring Boot \u63d0\u4f9b\u4e86\u8bb8\u591a\u6838\u5fc3\u529f\u80fd\uff0c\u65e8\u5728\u7b80\u5316 Spring \u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u90e8\u7f72\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b Spring Boot \u7684\u6838\u5fc3\u529f\u80fd\uff1a<\/p>\n<ol>\n<li>\n<strong>\u81ea\u52a8\u914d\u7f6e\uff08Auto-Configuration\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u4f7f\u7528\u6761\u4ef6\u5316\u7684\u81ea\u52a8\u914d\u7f6e\uff0c\u6839\u636e\u5e94\u7528\u7a0b\u5e8f\u7684\u4f9d\u8d56\u81ea\u52a8\u914d\u7f6e Spring \u4e0a\u4e0b\u6587\u3001\u6570\u636e\u6e90\u3001\u4e8b\u52a1\u7ba1\u7406\u3001Web \u7b49\u3002\u5f00\u53d1\u8005\u65e0\u9700\u624b\u52a8\u914d\u7f6e\uff0c\u51cf\u5c11\u4e86\u6837\u677f\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5d4c\u5165\u5f0f Web \u670d\u52a1\u5668\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u652f\u6301\u5d4c\u5165\u5f0f Web \u670d\u52a1\u5668\uff0c\u5982 Tomcat\u3001Jetty\u3001Undertow\uff0c\u65e0\u9700\u5916\u90e8\u5bb9\u5668\u3002\u8fd9\u7b80\u5316\u4e86\u90e8\u7f72\u548c\u8fd0\u884c Spring \u5e94\u7528\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u7ea6\u5b9a\u5927\u4e8e\u914d\u7f6e\uff08Convention over Configuration\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u9075\u5faa\u7ea6\u5b9a\u5927\u4e8e\u914d\u7f6e\u7684\u539f\u5219\uff0c\u63d0\u4f9b\u4e86\u4e00\u81f4\u7684\u9879\u76ee\u7ed3\u6784\u548c\u9ed8\u8ba4\u914d\u7f6e\uff0c\u51cf\u5c11\u4e86\u5f00\u53d1\u8005\u7684\u914d\u7f6e\u5de5\u4f5c\uff0c\u63d0\u9ad8\u4e86\u9879\u76ee\u7684\u6807\u51c6\u5316\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u8d77\u6b65\u4f9d\u8d56\uff08Starter Dependencies\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>\u8d77\u6b65\u4f9d\u8d56\u662f\u4e00\u7ec4\u9884\u914d\u7f6e\u7684 Maven \u6216 Gradle \u4f9d\u8d56\u9879\uff0c\u53ef\u7b80\u5316\u7279\u5b9a\u7c7b\u578b\u5e94\u7528\u7a0b\u5e8f\u7684\u6784\u5efa\u914d\u7f6e\u3002\u901a\u8fc7\u9009\u62e9\u5408\u9002\u7684\u8d77\u6b65\u4f9d\u8d56\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5feb\u901f\u96c6\u6210\u5404\u79cd\u529f\u80fd\uff0c\u5982 Web\u3001\u6570\u636e\u8bbf\u95ee\u3001\u5b89\u5168\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>\u5916\u90e8\u5316\u914d\u7f6e\uff08Externalized Configuration\uff09\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u652f\u6301\u5c06\u914d\u7f6e\u4fe1\u606f\u4ece\u4ee3\u7801\u4e2d\u5206\u79bb\u51fa\u6765\uff0c\u901a\u8fc7\u5916\u90e8\u5316\u914d\u7f6e\u6587\u4ef6\uff08\u5982 <code>application.properties<\/code> \u6216 <code>application.yml<\/code>\uff09\u8fdb\u884c\u914d\u7f6e\u3002\u8fd9\u4f7f\u5f97\u914d\u7f6e\u7684\u7ba1\u7406\u66f4\u52a0\u7075\u6d3b\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot CLI\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot CLI \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u5feb\u901f\u5f00\u53d1 Spring \u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4ee5\u66f4\u7b80\u5355\u7684\u65b9\u5f0f\u7f16\u5199\u548c\u8fd0\u884c Spring \u4ee3\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot Actuator\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot Actuator \u63d0\u4f9b\u4e86\u4e00\u7ec4\u751f\u4ea7\u73af\u5883\u4e2d\u5e38\u7528\u7684\u529f\u80fd\uff0c\u5305\u62ec\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u7684\u5065\u5eb7\u72b6\u6001\u3001\u5ea6\u91cf\u4fe1\u606f\u3001\u5e94\u7528\u7a0b\u5e8f\u4fe1\u606f\u7b49\u3002\u53ef\u4ee5\u901a\u8fc7 HTTP\u3001JMX \u6216 Shell \u8bbf\u95ee\u8fd9\u4e9b\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot DevTools\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot DevTools \u63d0\u4f9b\u4e86\u4e00\u7ec4\u5f00\u53d1\u5de5\u5177\uff0c\u5982\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u7a0b\u5e8f\u3001\u7981\u7528\u6a21\u677f\u7f13\u5b58\u7b49\uff0c\u7528\u4e8e\u63d0\u9ad8\u5f00\u53d1\u4f53\u9a8c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot Test\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot Test \u63d0\u4f9b\u4e86\u4e00\u7ec4\u6d4b\u8bd5\u652f\u6301\uff0c\u5305\u62ec <code>@SpringBootTest<\/code> \u6ce8\u89e3\u3001\u81ea\u52a8\u914d\u7f6e\u7684\u6d4b\u8bd5\u73af\u5883\u3001\u5185\u5b58\u6570\u636e\u5e93\u7b49\uff0c\u65b9\u4fbf\u7f16\u5199\u5355\u5143\u6d4b\u8bd5\u548c\u96c6\u6210\u6d4b\u8bd5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot Initializr\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot Initializr \u662f\u4e00\u4e2a web \u5de5\u5177\uff0c\u7528\u4e8e\u751f\u6210\u57fa\u4e8e Spring Boot \u7684\u9879\u76ee\u6a21\u677f\u3002\u5b83\u7b80\u5316\u4e86\u65b0\u9879\u76ee\u7684\u521d\u59cb\u5316\u8fc7\u7a0b\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u9009\u62e9\u9879\u76ee\u7684\u4f9d\u8d56\u548c\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot \u652f\u6301\u5404\u79cd\u6570\u636e\u8bbf\u95ee\u6280\u672f\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u63d0\u4f9b\u4e86\u5bf9\u591a\u79cd\u6570\u636e\u8bbf\u95ee\u6280\u672f\u7684\u96c6\u6210\u652f\u6301\uff0c\u5305\u62ec JPA\u3001Hibernate\u3001MyBatis\u3001Spring Data JPA\u3001Spring Data MongoDB \u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<strong>Spring Boot \u652f\u6301\u5404\u79cd\u96c6\u6210\u6280\u672f\uff1a<\/strong><\/p>\n<ul>\n<li>Spring Boot \u63d0\u4f9b\u4e86\u5bf9\u6d88\u606f\u961f\u5217\u3001\u7f13\u5b58\u3001\u641c\u7d22\u5f15\u64ce\u3001\u5b89\u5168\u6846\u67b6\u7b49\u591a\u79cd\u96c6\u6210\u6280\u672f\u7684\u652f\u6301\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u80fd\u591f\u66f4\u5bb9\u6613\u5730\u96c6\u6210\u8fd9\u4e9b\u6280\u672f\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u8fd9\u4e9b\u6838\u5fc3\u529f\u80fd\u4f7f\u5f97 Spring Boot \u6210\u4e3a\u4e00\u4e2a\u5f3a\u5927\u800c\u7075\u6d3b\u7684\u6846\u67b6\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ece\u7b80\u5355\u7684 REST \u670d\u52a1\u5230\u590d\u6742\u7684\u4f01\u4e1a\u7ea7\u5e94\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot \u63d0\u4f9b\u4e86\u8bb8\u591a\u6838\u5fc3\u529f\u80fd\uff0c\u65e8\u5728\u7b80\u5316 Spring \u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u90e8\u7f72\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b Spri [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100],"tags":[],"class_list":["post-8677","post","type-post","status-publish","format-standard","hentry","category-springboot"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=8677"}],"version-history":[{"count":2,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8677\/revisions"}],"predecessor-version":[{"id":16652,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/8677\/revisions\/16652"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=8677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=8677"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=8677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}