{"id":7174,"date":"2026-08-14T15:50:02","date_gmt":"2026-08-14T07:50:02","guid":{"rendered":"https:\/\/t.n-years.com\/?p=7174"},"modified":"2026-08-14T15:50:02","modified_gmt":"2026-08-14T07:50:02","slug":"%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e6%8e%8c%e6%8f%a1%e4%b8%80%e4%b8%aa%e5%90%8e%e7%ab%af%e5%b7%a5%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=7174","title":{"rendered":"\u5982\u4f55\u5feb\u901f\u638c\u63e1\u4e00\u4e2a\u540e\u7aef\u5de5\u7a0b"},"content":{"rendered":"<p>\u5feb\u901f\u638c\u63e1\u540e\u7aef\u5de5\u7a0b\u7684\u5173\u952e\u4e0d\u662f\u5148\u8bfb\u5b8c\u4ee3\u7801\uff0c\u800c\u662f\u5efa\u7acb\u4e00\u5f20\u201c<strong>\u8bf7\u6c42\u5982\u4f55\u8fdb\u6765\u3001\u6570\u636e\u5982\u4f55\u6d41\u52a8\u3001\u80fd\u529b\u5982\u4f55\u88ab\u7ea6\u675f<\/strong>\u201d\u7684\u5730\u56fe\u3002<\/p>\n<p><strong>\u5148\u6293\u4e3b\u7ebf<\/strong><\/p>\n<ol>\n<li>\u770b\u6839\u76ee\u5f55\u7684 <code>README<\/code>\u3001<code>pom.xml<\/code> \/ <code>build.gradle<\/code>\u3001\u90e8\u7f72\u914d\u7f6e\u3002<\/li>\n<li>\u786e\u8ba4\u6280\u672f\u6808\uff1aSpring Boot\u3001\u6570\u636e\u5e93\u3001\u7f13\u5b58\u3001MQ\u3001RPC\u3001\u914d\u7f6e\u4e2d\u5fc3\u3001\u9274\u6743\u65b9\u5f0f\u3002<\/li>\n<li>\u8fd0\u884c\u5de5\u7a0b\u6216\u542f\u52a8\u4e00\u4e2a\u670d\u52a1\uff0c\u786e\u8ba4\u542f\u52a8\u5165\u53e3\u3001\u73af\u5883\u53d8\u91cf\u548c\u4f9d\u8d56\u4e2d\u95f4\u4ef6\u3002<\/li>\n<li>\u4efb\u9009\u4e00\u4e2a\u6838\u5fc3\u63a5\u53e3\uff0c\u4ece URL \u8ddf\u5230\u6570\u636e\u5e93\uff0c\u8dd1\u901a\u5b8c\u6574\u8c03\u7528\u94fe\u3002<\/li>\n<\/ol>\n<pre><code class=\"language-text\">\u8bf7\u6c42 \u2192 Filter \/ Interceptor \u2192 Controller\n     \u2192 Service \u2192 DAO \/ RPC \/ MQ\n     \u2192 DB \/ Redis \u2192 \u54cd\u5e94<\/code><\/pre>\n<p><strong>\u6309\u91cd\u8981\u6027\u9605\u8bfb\u4ee3\u7801<\/strong><\/p>\n<ul>\n<li><strong>\u5165\u53e3\u5c42<\/strong>\uff1a<code>Controller<\/code>\u3001<code>@RequestMapping<\/code>\u3001<code>Filter<\/code>\u3001<code>Interceptor<\/code>\u3001\u5168\u5c40\u5f02\u5e38\u5904\u7406\u3002<\/li>\n<li><strong>\u4e1a\u52a1\u5c42<\/strong>\uff1a\u6838\u5fc3 <code>Service<\/code>\u3001\u4e8b\u52a1 <code>@Transactional<\/code>\u3001\u72b6\u6001\u673a\u3001\u9886\u57df\u5bf9\u8c61\u3002<\/li>\n<li><strong>\u6570\u636e\u5c42<\/strong>\uff1a<code>Mapper<\/code> \/ Repository\u3001\u5b9e\u4f53\u3001SQL\u3001\u8868\u7ed3\u6784\u548c\u7d22\u5f15\u3002<\/li>\n<li><strong>\u57fa\u7840\u8bbe\u65bd<\/strong>\uff1aRedis\u3001MQ\u3001RPC Client\u3001\u5b9a\u65f6\u4efb\u52a1\u3001\u6587\u4ef6\u5b58\u50a8\u3001\u7b2c\u4e09\u65b9\u63a5\u53e3\u3002<\/li>\n<li><strong>\u6a2a\u5207\u80fd\u529b<\/strong>\uff1a\u9274\u6743\u3001\u6743\u9650\u3001\u79df\u6237\u3001\u5ba1\u8ba1\u65e5\u5fd7\u3001\u5e42\u7b49\u3001\u9650\u6d41\u3001\u7070\u5ea6\u3001\u76d1\u63a7\u3002<\/li>\n<\/ul>\n<p><strong>\u4f18\u5148\u56de\u7b54\u7684 10 \u4e2a\u95ee\u9898<\/strong><\/p>\n<ol>\n<li>\u5de5\u7a0b\u6709\u54ea\u4e9b\u6a21\u5757\uff1f\u6bcf\u4e2a\u6a21\u5757\u8d1f\u8d23\u4ec0\u4e48\uff1f<\/li>\n<li>\u670d\u52a1\u4ece\u54ea\u91cc\u542f\u52a8\uff1f\u6709\u54ea\u4e9b profile \u548c\u914d\u7f6e\u6765\u6e90\uff1f<\/li>\n<li>\u6700\u6838\u5fc3\u7684 3\uff5e5 \u4e2a\u4e1a\u52a1\u63a5\u53e3\u662f\u4ec0\u4e48\uff1f<\/li>\n<li>\u4e00\u6b21\u8bf7\u6c42\u7ecf\u8fc7\u54ea\u4e9b\u8fc7\u6ee4\u5668\u3001\u62e6\u622a\u5668\u548c AOP\uff1f<\/li>\n<li>\u7528\u6237\u8eab\u4efd\u4ece\u54ea\u91cc\u6765\uff0c\u9274\u6743\u5728\u54ea\u91cc\u505a\uff1f<\/li>\n<li>\u6838\u5fc3\u6570\u636e\u8868\u6709\u54ea\u4e9b\uff0c\u4e3b\u952e\u3001\u72b6\u6001\u5b57\u6bb5\u3001\u5173\u8054\u5173\u7cfb\u662f\u4ec0\u4e48\uff1f<\/li>\n<li>\u54ea\u4e9b\u64cd\u4f5c\u8981\u4e8b\u52a1\uff0c\u4e8b\u52a1\u8fb9\u754c\u5728\u54ea\uff1f<\/li>\n<li>Redis \/ MQ \/ RPC \u5728\u4ec0\u4e48\u573a\u666f\u4f7f\u7528\uff0c\u5931\u8d25\u5982\u4f55\u5904\u7406\uff1f<\/li>\n<li>\u5f02\u5e38\u5982\u4f55\u8fd4\u56de\uff0c\u65e5\u5fd7\u3001\u94fe\u8def\u8ffd\u8e2a\u548c\u544a\u8b66\u600e\u4e48\u505a\uff1f<\/li>\n<li>\u5982\u4f55\u6d4b\u8bd5\u3001\u6784\u5efa\u3001\u53d1\u5e03\u548c\u56de\u6eda\uff1f<\/li>\n<\/ol>\n<p><strong>\u9ad8\u6548\u641c\u7d22\u65b9\u5f0f<\/strong><\/p>\n<ul>\n<li>\u627e API\uff1a<code>rg -n &#039;@(Get|Post|Put|Delete|Request)Mapping&#039; --glob &#039;*.java&#039;<\/code><\/li>\n<li>\u627e\u6838\u5fc3\u4e1a\u52a1\u8bcd\uff1a<code>rg -n -i &#039;\u8ba2\u5355|\u53d1\u5e03|\u7528\u6237|permission&#039; --glob &#039;*.java&#039;<\/code><\/li>\n<li>\u627e\u8c03\u7528\uff1a<code>rg -n &#039;\\b\u65b9\u6cd5\u540d\\s*\\(&#039; --glob &#039;*.java&#039;<\/code><\/li>\n<li>\u627e\u8868\u6216 SQL\uff1a<code>rg -n &#039;\u8868\u540d|SELECT|INSERT|UPDATE&#039;<\/code><\/li>\n<li>\u627e\u914d\u7f6e\uff1a<code>rg --files | rg &#039;application.*\\.(yml|yaml|properties)$&#039;<\/code><\/li>\n<li>\u627e\u5f02\u6b65\u903b\u8f91\uff1a<code>rg -n &#039;@Async|@Scheduled|KafkaListener|RabbitListener|Consumer&#039;<\/code><\/li>\n<\/ul>\n<p><strong>\u5efa\u8bae\u8282\u594f<\/strong><\/p>\n<ul>\n<li><strong>\u7b2c 1 \u5c0f\u65f6<\/strong>\uff1a\u76ee\u5f55\u3001\u6a21\u5757\u3001\u542f\u52a8\u65b9\u5f0f\u3001\u914d\u7f6e\u3001\u4f9d\u8d56\u3002<\/li>\n<li><strong>\u7b2c 1 \u5929<\/strong>\uff1a\u8dd1\u901a\u4e00\u4e2a\u6838\u5fc3\u8bf7\u6c42\u94fe\u8def\uff1b\u7406\u89e3\u8868\u3001\u7f13\u5b58\u3001\u6743\u9650\u3002<\/li>\n<li><strong>\u7b2c 2 \u5929<\/strong>\uff1a\u7406\u89e3\u5f02\u5e38\u3001\u4e8b\u52a1\u3001\u5f02\u6b65\u4efb\u52a1\u3001MQ\/RPC \u548c\u53ef\u89c2\u6d4b\u6027\u3002<\/li>\n<li><strong>\u7b2c 3 \u5929<\/strong>\uff1a\u6311\u4e00\u4e2a\u5c0f\u9700\u6c42\u6216 bug\uff0c\u5b8c\u6210\u4e00\u6b21\u201c\u5b9a\u4f4d \u2192 \u4fee\u6539 \u2192 \u6d4b\u8bd5 \u2192 \u53d1\u5e03\u94fe\u8def\u201d\u95ed\u73af\u3002<\/li>\n<\/ul>\n<p><strong>\u8f93\u51fa\u81ea\u5df1\u7684\u5de5\u7a0b\u5730\u56fe<\/strong><br \/>\n\u5efa\u8bae\u7ef4\u62a4\u4e00\u9875\u7b14\u8bb0\uff0c\u5185\u5bb9\u53ea\u8981\u5305\u542b\uff1a<\/p>\n<pre><code class=\"language-text\">\u6a21\u5757\u804c\u8d23\n\u6838\u5fc3\u63a5\u53e3\u4e0e\u8c03\u7528\u94fe\n\u6838\u5fc3\u8868\u4e0e\u72b6\u6001\u6d41\u8f6c\n\u8ba4\u8bc1 \/ \u6743\u9650\u6a21\u578b\n\u5916\u90e8\u4f9d\u8d56\uff08DB\u3001Redis\u3001MQ\u3001RPC\uff09\n\u542f\u52a8\u3001\u6d4b\u8bd5\u3001\u53d1\u5e03\u547d\u4ee4\n\u98ce\u9669\u70b9\u4e0e\u672a\u7406\u89e3\u95ee\u9898<\/code><\/pre>\n<p>\u5bf9\u5f53\u524d\u8fd9\u7c7b\u591a\u6a21\u5757 Spring Boot \u5de5\u7a0b\uff0c\u5148\u4ece Web\/API \u6a21\u5757\u5f00\u59cb\uff0c\u6cbf <code>Controller \u2192 Service \u2192 Mapper\/RPC<\/code> \u5411\u4e0b\u8ffd\uff1b\u4e0d\u8981\u4e00\u5f00\u59cb\u94bb\u8fdb <code>common<\/code>\u3001<code>adapter<\/code> \u7b49\u5e95\u5c42\u516c\u5171\u6a21\u5757\u3002\u8fd9\u6837\u6700\u5feb\u5f62\u6210\u53ef\u5de5\u4f5c\u7684\u5168\u5c40\u8ba4\u77e5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5feb\u901f\u638c\u63e1\u540e\u7aef\u5de5\u7a0b\u7684\u5173\u952e\u4e0d\u662f\u5148\u8bfb\u5b8c\u4ee3\u7801\uff0c\u800c\u662f\u5efa\u7acb\u4e00\u5f20\u201c\u8bf7\u6c42\u5982\u4f55\u8fdb\u6765\u3001\u6570\u636e\u5982\u4f55\u6d41\u52a8\u3001\u80fd\u529b\u5982\u4f55\u88ab\u7ea6\u675f\u201d\u7684\u5730\u56fe\u3002 \u5148\u6293&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=7174\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[123],"tags":[],"class_list":["post-7174","post","type-post","status-publish","format-standard","hentry","category-123"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7174"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7174\/revisions"}],"predecessor-version":[{"id":7175,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/7174\/revisions\/7175"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}