{"id":117693,"date":"2026-10-25T07:16:29","date_gmt":"2026-10-24T23:16:29","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117693.html"},"modified":"2026-10-25T07:16:29","modified_gmt":"2026-10-24T23:16:29","slug":"spring-%e5%a3%b0%e6%98%8e%e5%bc%8f%e4%ba%8b%e5%8a%a1%e4%b8%83%e5%a4%a7%e5%a4%b1%e6%95%88%e5%9c%ba%e6%99%af%e6%b7%b1%e5%ba%a6%e5%89%96%e6%9e%90%ef%bc%88%e4%b8%89%ef%bc%89%ef%bc%9a%e5%90%8c%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117693.html","title":{"rendered":"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024231628-6add3c4c96039.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u7ecf\u5386\u4e86\u524d\u4e24\u7bc7\u5173\u4e8e\u201c\u5f02\u5e38\u7c7b\u578b\u541e\u56de\u6eda\u201d\u3001\u201c\u975e public \u4fee\u9970\u7b26\u88ab\u9759\u9ed8\u8df3\u8fc7\u201d\u4ee5\u53ca\u201c\u591a\u6570\u636e\u6e90\u5355\u8fb9\u63d0\u4ea4\u201d\u7684\u6d17\u793c\u4e4b\u540e&#xff0c;\u6211\u4eec\u6765\u5230\u4e86 Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u5931\u6548\u5927\u8d4f\u4e2d\u6700\u5177\u6709\u6b3a\u9a97\u6027\u3001\u4e5f\u6700\u5bb9\u6613\u5728\u8001\u7cfb\u7edf\u91cd\u6784\u65f6\u5f15\u53d1\u91cd\u5927\u8d44\u635f\u4e8b\u6545\u7684\u7ec8\u6781\u5927\u5751\u2014\u2014\u540c\u7c7b\u5185\u90e8\u65b9\u6cd5\u8c03\u7528&#xff08;Self-Invocation&#xff09;\u5bfc\u81f4\u7684\u4ee3\u7406\u5c42\u88ab\u5b8c\u5168\u7ed5\u8fc7\u3002<\/p>\n<p>\u573a\u666f\u662f\u5982\u6b64\u719f\u6089&#xff0c;\u51e0\u4e4e\u6bcf\u4e2a Java \u5de5\u7a0b\u5e08\u7684\u4ee3\u7801\u5e93\u91cc\u90fd\u66fe\u7ecf\u8eba\u8fc7\u7c7b\u4f3c\u7684\u903b\u8f91&#xff1a;\u5728\u67d0\u4e2a\u6838\u5fc3\u7684 OrderTradeService \u7c7b\u91cc&#xff0c;\u6709\u4e00\u4e2a\u9762\u5411\u5916\u90e8\u7684\u516c\u5171\u5165\u53e3\u65b9\u6cd5 submitOrder()\u3002\u5728\u8fd9\u4e2a\u65b9\u6cd5\u4e2d&#xff0c;\u5f00\u53d1\u4eba\u5458\u5148\u505a\u4e86\u4e00\u5806\u590d\u6742\u7684\u53c2\u6570\u6821\u9a8c\u3001\u98ce\u63a7\u6253\u5206&#xff1b;\u968f\u540e&#xff0c;\u4e3a\u4e86\u8ba9\u4ee3\u7801\u903b\u8f91\u66f4\u6a21\u5757\u5316\u3001\u804c\u8d23\u66f4\u6e05\u6670&#xff0c;\u4ed6\u5f88\u81ea\u7136\u5730\u5728\u540c\u4e00\u4e2a\u7c7b\u91cc\u63d0\u53d6\u51fa\u4e86\u4e00\u4e2a\u5b50\u65b9\u6cd5 doSaveDatabaseTransactional()&#xff0c;\u5e76\u4e14\u6781\u4e3a\u8ba4\u771f\u5730\u5728\u8be5\u5b50\u65b9\u6cd5\u4e0a\u6302\u4e86&#xff1a;<\/p>\n<p>&#064;Transactional(rollbackFor &#061; Exception.class, propagation &#061; Propagation.REQUIRES_NEW)<\/p>\n<p>\u5728\u672c\u5730\u5355\u5143\u6d4b\u8bd5\u6216\u8005\u81ea\u6d4b\u65f6&#xff0c;\u5982\u679c\u8d70\u7684\u662f\u6b63\u5e38\u6210\u529f\u8def\u5f84&#xff0c;\u6570\u636e\u5e93\u91cc\u786e\u5b9e\u63d2\u5165\u4e86\u6570\u636e&#xff0c;\u5927\u5bb6\u89c9\u5f97\u4e00\u5207\u5c3d\u5728\u638c\u63e1\u3002\u76f4\u5230\u67d0\u4e00\u5929\u5927\u4fc3\u538b\u6d4b\u6216\u8005\u771f\u5b9e\u7ebf\u4e0a\u6545\u969c&#xff0c;\u5185\u90e8\u65b9\u6cd5\u5728\u6267\u884c\u5230\u4e00\u534a\u65f6\u629b\u51fa\u4e86\u6570\u636e\u5e93\u552f\u4e00\u952e\u51b2\u7a81\u6216\u8005\u672a\u6355\u83b7\u7684\u8fd0\u884c\u65f6\u5f02\u5e38&#xff0c;\u6574\u4e2a\u4ea4\u6613\u94fe\u8def\u9000\u51fa\u3002\u6b64\u65f6\u7814\u53d1\u540c\u5b66\u6253\u5f00\u6570\u636e\u5e93\u4e00\u770b&#xff0c;\u6574\u4e2a\u4eba\u5f7b\u5e95\u50bb\u4e86\u773c&#xff1a;\u524d\u9762\u7684\u810f\u6570\u636e\u4e0d\u4ec5\u6ca1\u6709\u56de\u6eda&#xff0c;\u751a\u81f3\u8fde\u90a3\u4e2a\u88ab\u5bc4\u4e88\u539a\u671b\u7684 REQUIRES_NEW \u72ec\u7acb\u4e8b\u52a1\u6839\u672c\u5c31\u4ece\u6765\u6ca1\u6709\u88ab\u5f00\u542f\u8fc7&#xff01;<\/p>\n<p>\u4eca\u5929\u6211\u4eec\u5c31\u5bf9\u8fd9\u8d77\u7ecf\u5178\u4e8b\u6545\u505a\u4e00\u6b21\u6df1\u5ea6\u7684\u6e90\u7801\u7ea7\u201c\u6cd5\u533b\u5207\u7247\u201d&#xff0c;\u770b\u6e05\u52a8\u6001\u4ee3\u7406\u5728\u5b57\u8282\u7801\u8c03\u7528\u65f6\u7684\u7269\u7406\u65ad\u5c42&#xff0c;\u5e76\u7ed9\u51fa\u4e24\u5957\u5f7b\u5e95\u6d88\u9664\u6b64\u7c7b\u9690\u60a3\u7684\u73b0\u4ee3\u5316\u91cd\u6784\u65b9\u6848\u3002<\/p>\n<h3>\u4e00\u3001\u52a8\u6001\u4ee3\u7406\u7684\u201c\u540c\u5fc3\u5706\u201d\u4e0e\u81ea\u8c03\u7528\u7684\u201c\u65ad\u5d16\u201d<\/h3>\n<p>\u8981\u5f7b\u5e95\u4ece\u8111\u6d77\u4e2d\u62b9\u53bb\u5bf9 &#064;Transactional \u7684\u8ff7\u4fe1&#xff0c;\u5fc5\u987b\u770b\u6e05 Spring \u4e8b\u52a1\u5207\u9762\u5728\u5185\u5b58\u4e2d\u7684\u771f\u5b9e\u5bc4\u751f\u5f62\u6001\u3002<\/p>\n<p>Spring \u7684\u58f0\u660e\u5f0f\u4e8b\u52a1\u5e76\u4e0d\u662f\u76f4\u63a5\u4fee\u6539\u4e86\u4f60\u5199\u7684\u90a3\u4e2a\u539f\u59cb .class \u6587\u4ef6\u7684\u5b57\u8282\u7801\u6307\u4ee4&#xff0c;\u800c\u662f\u57fa\u4e8e\u8bbe\u8ba1\u6a21\u5f0f\u4e2d\u7684\u88c5\u9970\u5668\u6a21\u5f0f&#xff08;Decorator&#xff09;\u4e0e\u52a8\u6001\u4ee3\u7406&#xff08;Dynamic Proxy&#xff09;\u3002<\/p>\n<p>\u5f53 Spring \u5bb9\u5668\u628a\u4e00\u4e2a\u88ab\u5207\u9762\u589e\u5f3a\u7684 Bean \u6ce8\u5165\u7ed9\u5916\u90e8\u7684 Controller \u65f6&#xff0c;Controller \u624b\u4e2d\u62ff\u5230\u7684\u6839\u672c\u4e0d\u662f\u4f60\u5199\u7684\u90a3\u4efd\u539f\u751f\u5bf9\u8c61&#xff0c;\u800c\u662f\u4e00\u4e2a\u7531 CGLIB \u52a8\u6001\u751f\u6210\u7684\u5b50\u7c7b\u4ee3\u7406\u5b9e\u4f8b&#xff1a;<\/p>\n<p>[\u5916\u90e8 Controller \u53d1\u8d77\u8c03\u7528: orderService.submitOrder()]<br \/>\n             |<br \/>\n             v<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| Spring CGLIB \u52a8\u6001\u4ee3\u7406\u5bf9\u8c61 (OrderService$$SpringCGLIB$$0)     |<br \/>\n|                                                             |<br \/>\n|   1. \u62e6\u622a\u5668\u94fe\u4ecb\u5165: \u53d1\u73b0 submitOrder() \u6ca1\u6709\u52a0 &#064;Transactional  |<br \/>\n|   2. \u51b3\u5b9a\u76f4\u63a5\u900f\u4f20&#xff0c;\u53cd\u5c04\u8c03\u7528\u5e95\u5c42\u7684\u771f\u5b9e\u76ee\u6807\u5b9e\u4f8b Target:        |<br \/>\n|                                                             |<br \/>\n|   &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043; |<br \/>\n|   | \u771f\u5b9e\u7269\u7406\u76ee\u6807\u5bf9\u8c61 Target (OrderServiceImpl \u88f8\u5bf9\u8c61\u5b9e\u4f8b)   | |<br \/>\n|   |                                                       | |<br \/>\n|   |   submitOrder() {                                     | |<br \/>\n|   |       \/\/ \u4e1a\u52a1\u6821\u9a8c&#8230;                                  | |<br \/>\n|   |                                                       | |<br \/>\n|   |       \/\/ \u5173\u952e\u65ad\u5d16\u7206\u53d1\u70b9&#xff01;                               | |<br \/>\n|   |       \/\/ \u6b64\u65f6\u7684\u8c03\u7528\u7b49\u4ef7\u4e8e: this.doSaveDatabaseTransactional() |<br \/>\n|   |       this.doSaveDatabaseTransactional(); &lt;&#8212;&#8212;&#8212;&#8211;&#043;-&#043;&#8211; \u81f4\u547d\u65ad\u5d16!<br \/>\n|   |   }                                                   | |<br \/>\n|   |                                                       | |<br \/>\n|   |   &#064;Transactional                                      | |<br \/>\n|   |   doSaveDatabaseTransactional() { &#8230; }               | |<br \/>\n|   &#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043; |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<\/p>\n<p>\u8bf7\u6b7b\u6b7b\u76ef\u4f4f\u56fe\u4e2d\u7684\u90a3\u4e2a\u65ad\u5d16&#xff1a;<\/p>\n<li>Controller \u8c03\u7528\u7684\u786e\u5b9e\u662f\u5916\u5c42\u7684\u4ee3\u7406\u5bf9\u8c61&#xff08;Proxy&#xff09;&#xff1b;<\/li>\n<li>\u4ee3\u7406\u5bf9\u8c61\u628a\u63a7\u5236\u6743\u79fb\u4ea4\u7ed9\u4e86\u5185\u90e8\u7684\u7269\u7406\u771f\u5b9e\u76ee\u6807\u5bf9\u8c61&#xff08;Target&#xff09;&#xff1b;<\/li>\n<li>\u5728\u7269\u7406\u76ee\u6807\u5bf9\u8c61\u7684 submitOrder() \u5185\u90e8&#xff0c;\u6267\u884c\u4e86 this.doSaveDatabaseTransactional()&#xff1b;<\/li>\n<li>\u6b64\u65f6\u7684 this&#xff0c;\u6307\u5411\u7684\u662f\u6ca1\u6709\u88ab\u4efb\u4f55\u5207\u9762\u5305\u88c5\u7684\u539f\u751f Java \u5b9e\u4f8b&#xff01;<\/li>\n<li>\u8be5\u8c03\u7528\u76f4\u63a5\u5728 JVM \u672c\u5730\u65b9\u6cd5\u533a\u5b8c\u6210\u4e86\u76f4\u63a5\u8df3\u8f6c&#xff0c;\u6839\u672c\u6ca1\u6709\u7ecf\u8fc7\u5916\u5c42\u4ee3\u7406\u5bf9\u8c61\u7684 MethodInterceptor \u62e6\u622a\u94fe&#xff01;<\/li>\n<p>\u65e2\u7136\u6839\u672c\u6ca1\u6709\u8d70\u4ee3\u7406\u62e6\u622a\u5668&#xff0c;\u90a3\u4e48 Spring \u7684 TransactionInterceptor \u538b\u6839\u8fde\u8fd9\u4e2a\u65b9\u6cd5\u88ab\u8c03\u7528\u4e86\u90fd\u6beb\u4e0d\u77e5\u60c5&#xff01;\u4ec0\u4e48 doBegin() \u5f00\u542f\u4e8b\u52a1\u3001\u4ec0\u4e48 REQUIRES_NEW \u6302\u8d77\u5916\u5c42\u8fde\u63a5\u3001\u4ec0\u4e48\u5f02\u5e38\u6355\u83b7\u56de\u6eda&#xff0c;\u7edf\u7edf\u5168\u90e8\u6ca6\u4e3a\u7a7a\u8c08&#xff01;<\/p>\n<h3>\u4e8c\u3001\u6e90\u7801\u7aa5\u63a2&#xff1a;\u4e3a\u4ec0\u4e48 CGLIB \u4e5f\u65e0\u6cd5\u62ef\u6551 this&#xff1f;<\/h3>\n<p>\u6709\u4e9b\u5bf9\u5b57\u8282\u7801\u6280\u672f\u6709\u4e00\u5b9a\u4e86\u89e3\u7684\u540c\u5b66\u4f1a\u53cd\u9a73&#xff1a;\u201cJDK \u52a8\u6001\u4ee3\u7406\u57fa\u4e8e\u63a5\u53e3&#xff0c;\u62e6\u622a\u4e0d\u5230 this \u5bb9\u6613\u7406\u89e3&#xff1b;\u4f46 CGLIB \u662f\u901a\u8fc7\u7ee7\u627f\u76ee\u6807\u7c7b\u3001\u91cd\u5199\u76ee\u6807\u7c7b\u7684\u6240\u6709\u65b9\u6cd5\u6765\u751f\u6210\u5b50\u7c7b\u7684&#xff0c;\u96be\u9053\u5728\u5b50\u7c7b\u91cc\u9762&#xff0c;\u91cd\u5199\u7684\u65b9\u6cd5\u8fd8\u6355\u83b7\u4e0d\u5230\u5417&#xff1f;\u201d<\/p>\n<p>\u6211\u4eec\u6765\u770b CGLIB \u751f\u6210\u7684\u4ee3\u7406\u7c7b\u5b57\u8282\u7801\u7684\u53cd\u7f16\u8bd1\u4f2a\u4ee3\u7801&#xff1a;<\/p>\n<p>\/\/ CGLIB \u751f\u6210\u7684\u4ee3\u7406\u5b50\u7c7b\u4f2a\u4ee3\u7801<br \/>\npublic class OrderServiceImpl$$EnhancerBySpringCGLIB$$1 extends OrderServiceImpl {<\/p>\n<p>    private MethodInterceptor CGLIB$CALLBACK_0;<\/p>\n<p>    &#064;Override<br \/>\n    public void submitOrder() {<br \/>\n        MethodInterceptor interceptor &#061; this.CGLIB$CALLBACK_0;<br \/>\n        if (interceptor !&#061; null) {<br \/>\n            \/\/ \u8fdb\u5165\u62e6\u622a\u5668<br \/>\n            interceptor.intercept(this, method, args, methodProxy);<br \/>\n        } else {<br \/>\n            super.submitOrder();<br \/>\n        }<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void doSaveDatabaseTransactional() {<br \/>\n        \/\/ \u5982\u679c\u662f\u4ece\u5916\u90e8\u8c03\u7528&#xff0c;\u786e\u5b9e\u4f1a\u88ab\u62e6\u622a&#xff01;<br \/>\n        MethodInterceptor interceptor &#061; this.CGLIB$CALLBACK_0;<br \/>\n        interceptor.intercept(this, method, args, methodProxy);<br \/>\n    }<br \/>\n}<\/p>\n<p>\u770b\u6e05\u695a&#xff1a;\u5728\u62e6\u622a\u5668\u6267\u884c\u5b8c\u540e&#xff0c;\u5b83\u6700\u7ec8\u8c03\u7528\u7684\u662f\u76ee\u6807\u5bf9\u8c61\u7684 super.submitOrder()&#xff01;\u5728\u6267\u884c\u7236\u7c7b\u7684 submitOrder() \u65b9\u6cd5\u4f53\u65f6&#xff0c;\u7f16\u8bd1\u751f\u6210\u7684\u5b57\u8282\u7801\u662f&#xff1a;<\/p>\n<p>aload_0         \/\/ \u5c06 this \u63a8\u5165\u64cd\u4f5c\u6570\u6808 (\u6307\u5411\u7684\u662f\u539f\u751f\u7236\u7c7b\u5b9e\u4f8b\u4e0a\u4e0b\u6587)<br \/>\ninvokevirtual   #42 &lt;com\/yali\/trade\/service\/OrderServiceImpl.doSaveDatabaseTransactional&gt;<\/p>\n<p>\u5728 JVM \u7684\u6307\u4ee4\u89c4\u8303\u4e2d&#xff0c;aload_0 \u7ed1\u5b9a\u7684\u4e0a\u4e0b\u6587\u51b3\u5b9a\u4e86\u5b83\u8c03\u7528\u7684\u4f9d\u7136\u662f\u81ea\u8eab\u65b9\u6cd5\u4f53\u5185\u90e8\u7684\u5b9e\u73b0&#xff0c;\u4e00\u65e6\u8fdb\u5165\u4e86\u539f\u751f\u7236\u7c7b\u7684\u65b9\u6cd5\u5185\u90e8&#xff0c;\u540e\u7eed\u7684\u5185\u90e8\u8df3\u8f6c\u5df2\u7ecf\u5f7b\u5e95\u8131\u79bb\u4e86 CGLIB \u4ee3\u7406\u62e6\u622a\u5668\u7684\u638c\u63a7\u8303\u56f4&#xff01;<\/p>\n<h3>\u4e09\u3001\u7834\u5c40\u65b9\u6848\u4e00&#xff1a;\u4f7f\u7528\u7f16\u7a0b\u5f0f\u4e8b\u52a1&#xff08;TransactionTemplate&#xff09;\u964d\u7ef4\u6253\u51fb<\/h3>\n<p>\u5f88\u591a\u67b6\u6784\u5e08\u5728\u9047\u5230\u6b64\u7c7b\u95ee\u9898\u65f6&#xff0c;\u4e60\u60ef\u6027\u5730\u63a8\u8350\u7528\u201c\u81ea\u6ce8\u5165 &#064;Autowired &#064;Lazy private OrderService self;\u201d\u53bb\u89e3\u51b3\u3002<\/p>\n<p>\u4f46\u5728\u5927\u578b\u7535\u5546\u4ea4\u6613\u7684\u6838\u5fc3\u94fe\u8def\u4e2d&#xff0c;\u6211\u4e0d\u5efa\u8bae\u4e3a\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u5c40\u90e8\u4e8b\u52a1\u53bb\u641e\u8fd9\u79cd\u522b\u626d\u7684\u81ea\u5faa\u73af\u4f9d\u8d56\u3002\u6700\u5e72\u51c0\u3001\u6700\u5f7b\u5e95\u3001\u6027\u80fd\u6700\u9ad8\u7684\u65b9\u5f0f&#xff0c;\u662f\u4f7f\u7528 Spring \u539f\u751f\u63d0\u4f9b\u7684 TransactionTemplate \u7f16\u7a0b\u5f0f\u4e8b\u52a1&#xff01;<\/p>\n<p>\u7f16\u7a0b\u5f0f\u4e8b\u52a1\u5b8c\u5168\u4e0d\u4f9d\u8d56\u52a8\u6001\u4ee3\u7406\u3001\u4e0d\u4f9d\u8d56\u5207\u9762\u62e6\u622a\u3001\u4e0d\u4f9d\u8d56\u8bbf\u95ee\u4fee\u9970\u7b26&#xff0c;\u5b83\u76f4\u63a5\u5728\u4ee3\u7801\u5757\u5185\u90e8\u663e\u5f0f\u64cd\u7eb5\u4e8b\u52a1\u751f\u547d\u5468\u671f&#xff1a;<\/p>\n<p>package com.yali.trade.service.impl;<\/p>\n<p>import com.yali.trade.dao.OrderMapper;<br \/>\nimport com.yali.trade.dto.OrderDTO;<br \/>\nimport com.yali.trade.service.OrderService;<br \/>\nimport lombok.RequiredArgsConstructor;<br \/>\nimport lombok.extern.slf4j.Slf4j;<br \/>\nimport org.springframework.stereotype.Service;<br \/>\nimport org.springframework.transaction.support.TransactionTemplate;<\/p>\n<p>&#064;Slf4j<br \/>\n&#064;Service<br \/>\n&#064;RequiredArgsConstructor<br \/>\npublic class RobustOrderServiceImpl implements OrderService {<\/p>\n<p>    private final OrderMapper orderMapper;<br \/>\n    \/\/ \u6ce8\u5165\u4e8b\u52a1\u6a21\u7248&#xff08;Spring Boot \u81ea\u52a8\u88c5\u914d&#xff09;<br \/>\n    private final TransactionTemplate transactionTemplate;<\/p>\n<p>    &#064;Override<br \/>\n    public void submitOrder(OrderDTO order) {<br \/>\n        \/\/ 1. \u524d\u7f6e\u590d\u6742\u53c2\u6570\u6821\u9a8c\u3001\u98ce\u63a7\u6253\u5206&#xff08;\u5b8c\u5168\u4e0d\u9700\u8981\u4e8b\u52a1&#xff0c;\u96f6\u8fde\u63a5\u5360\u7528&#xff01;&#xff09;<br \/>\n        validateOrder(order);<br \/>\n        riskCheck(order);<\/p>\n<p>        \/\/ 2. \u6838\u5fc3\u6301\u4e45\u5316\u52a8\u4f5c&#xff1a;\u5229\u7528 TransactionTemplate \u663e\u5f0f\u5212\u5b9a\u4e8b\u52a1\u8fb9\u754c&#xff01;<br \/>\n        \/\/ \u65e0\u8bba\u6b64\u4ee3\u7801\u5904\u4e8e\u4ec0\u4e48\u65b9\u6cd5\u5185\u90e8&#xff0c;\u65e0\u8bba\u662f\u4e0d\u662f private&#xff0c;100% \u7edd\u5bf9\u751f\u6548&#xff01;<br \/>\n        Boolean isSuccess &#061; transactionTemplate.execute(status -&gt; {<br \/>\n            try {<br \/>\n                \/\/ \u771f\u6b63\u7684\u77ed\u5c0f\u6838\u5fc3\u4e8b\u52a1\u903b\u8f91<br \/>\n                orderMapper.insertOrder(order);<br \/>\n                orderMapper.insertOrderItems(order.getItems());<br \/>\n                return true;<br \/>\n            } catch (Exception ex) {<br \/>\n                log.error(&#034;\u672c\u5730\u8ba2\u5355\u4e8b\u52a1\u6267\u884c\u5931\u8d25&#xff0c;\u663e\u5f0f\u89e6\u53d1\u56de\u6eda&#xff01;orderId: {}&#034;, order.getId(), ex);<br \/>\n                \/\/ \u624b\u52a8\u6807\u8bb0\u56de\u6eda&#xff0c;\u6216\u8005\u76f4\u63a5\u5411\u5916\u629b RuntimeException<br \/>\n                status.setRollbackOnly();<br \/>\n                throw ex;<br \/>\n            }<br \/>\n        });<\/p>\n<p>        \/\/ 3. \u4e8b\u52a1\u63d0\u4ea4\u540e&#xff0c;\u518d\u89e6\u53d1\u53d1\u9001\u5f02\u6b65 MQ \u6d88\u606f<br \/>\n        if (Boolean.TRUE.equals(isSuccess)) {<br \/>\n            sendOrderCreatedNotice(order.getId());<br \/>\n        }<br \/>\n    }<\/p>\n<p>    private void validateOrder(OrderDTO order) {}<br \/>\n    private void riskCheck(OrderDTO order) {}<br \/>\n    private void sendOrderCreatedNotice(String orderId) {}<br \/>\n}<\/p>\n<p>\u4f7f\u7528 TransactionTemplate \u7684\u4e09\u5927\u6838\u5fc3\u6536\u76ca&#xff1a;<\/p>\n<li>\u5f7b\u5e95\u7c89\u788e\u4ee3\u7406\u5931\u6548&#xff1a;\u4e0d\u4f9d\u8d56\u4efb\u4f55\u53cd\u5c04\u4e0e\u5207\u9762&#xff0c;\u76f4\u63a5\u8c03\u7528\u5e95\u5c42 PlatformTransactionManager&#xff0c;\u4ee3\u7801\u600e\u4e48\u5199\u5c31\u600e\u4e48\u751f\u6548&#xff1b;<\/li>\n<li>\u6d88\u706d\u957f\u4e8b\u52a1&#xff1a;\u5c06\u8017\u65f6\u7684\u6821\u9a8c\u3001RPC \u8c03\u7528\u5b89\u5168\u5730\u9694\u79bb\u5728\u4e8b\u52a1\u4e4b\u5916&#xff0c;\u53ea\u6709\u771f\u6b63\u9700\u8981\u5199\u5e93\u7684 5 \u6beb\u79d2\u624d\u53bb\u7533\u8bf7\u6570\u636e\u5e93\u8fde\u63a5&#xff0c;\u6781\u5927\u62ef\u6551\u4e86\u6570\u636e\u5e93\u8fde\u63a5\u6c60&#xff1b;<\/li>\n<li>\u6781\u4f73\u7684\u53ef\u8bfb\u6027\u4e0e\u5355\u5143\u6d4b\u8bd5\u6027&#xff1a;\u4e8b\u52a1\u7684\u5f00\u542f\u4e0e\u56de\u6eda\u5728\u4ee3\u7801\u5757\u4e2d\u9ed1\u767d\u5206\u660e&#xff0c;Mock \u6d4b\u8bd5\u6781\u5176\u8f7b\u677e\u3002<\/li>\n<h3>\u56db\u3001\u7834\u5c40\u65b9\u6848\u4e8c&#xff1a;\u9886\u57df\u9a71\u52a8\u8bbe\u8ba1&#xff08;DDD&#xff09;\u7684\u5e94\u7528\u5c42\u4e0e\u9886\u57df\u5c42\u7269\u7406\u62c6\u5206<\/h3>\n<p>\u5982\u679c\u4ece\u66f4\u9ad8\u7ea7\u7684\u8f6f\u4ef6\u5de5\u7a0b\u67b6\u6784&#xff08;Clean Architecture \/ DDD&#xff09;\u6765\u770b&#xff0c;\u4e4b\u6240\u4ee5\u4f1a\u5728\u540c\u4e00\u4e2a Service \u91cc\u5199\u51fa\u201c\u975e\u4e8b\u52a1\u65b9\u6cd5\u8c03\u5185\u90e8\u4e8b\u52a1\u65b9\u6cd5\u201d&#xff0c;\u672c\u8d28\u4e0a\u66b4\u9732\u51fa\u7684\u662f\u9886\u57df\u804c\u8d23\u7684\u4e25\u91cd\u6df7\u6dc6&#xff01;<\/p>\n<ul>\n<li>\u90a3\u4e2a\u5305\u542b\u53c2\u6570\u6821\u9a8c\u3001\u5916\u90e8\u67e5\u8be2\u3001\u7f16\u6392\u6d41\u8f6c\u7684 submitOrder()&#xff0c;\u5c5e\u4e8e \u5e94\u7528\u7f16\u6392\u670d\u52a1&#xff08;Application Service&#xff09;&#xff1b;<\/li>\n<li>\u90a3\u4e2a\u9700\u8981\u4e25\u683c\u4fdd\u8bc1\u539f\u5b50\u6027\u3001\u6267\u884c\u5e95\u5c42\u843d\u5e93\u7684 doSaveDatabaseTransactional()&#xff0c;\u5c5e\u4e8e \u6838\u5fc3\u9886\u57df\u670d\u52a1&#xff08;Domain Service&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u5c06\u4e24\u8005\u7269\u7406\u62c6\u5f00&#xff1a;<\/p>\n<p>  [OrderApplicationService (\u5e94\u7528\u5c42)]<br \/>\n       |<br \/>\n       &#043;&#8212;&gt; \u6267\u884c\u6821\u9a8c\u3001\u98ce\u63a7<br \/>\n       |<br \/>\n       &#043;&#8212;&gt; \u8c03\u7528 orderDomainService.saveTransactional(order)  &lt;&#8212; \u6b63\u5e38\u7684\u5916\u90e8 Bean \u8c03\u7528!<br \/>\n                                                                    \u5207\u9762\u5b8c\u7f8e\u89e6\u53d1!<\/p>\n<p>\u5728\u67b6\u6784\u4e0a\u5efa\u7acb\u4e25\u8c28\u7684\u5206\u5c42\u89c4\u8303&#xff1a;\u5e94\u7528\u670d\u52a1\u53ea\u7ba1\u7f16\u6392&#xff0c;\u9886\u57df\u670d\u52a1\u53ea\u7ba1\u539f\u5b50\u4e8b\u52a1\u3002\u7269\u7406\u4e0a\u7684\u7c7b\u9694\u79bb\u4e0d\u4ec5\u8ba9\u4ee3\u7406\u5207\u9762 100% \u6b63\u5e38\u751f\u6548&#xff0c;\u66f4\u8ba9\u7cfb\u7edf\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u4e0e\u6269\u5c55\u6027\u63d0\u5347\u4e86\u4e00\u4e2a\u6863\u6b21\u3002<\/p>\n<h3>\u4e94\u3001\u67b6\u6784\u5e08\u5fc3\u6cd5<\/h3>\n<p>\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u7684 Bug&#xff0c;\u5e38\u5e38\u8bde\u751f\u4e8e\u201c\u4ee5\u4e3a\u5b83\u4f1a\u751f\u6548\u201d\u7684\u76f2\u76ee\u81ea\u4fe1\u4e2d\u3002<\/p>\n<p>\u6ce8\u89e3\u7f16\u7a0b&#xff08;Annotation-driven&#xff09;\u6781\u5927\u5730\u63d0\u9ad8\u4e86\u751f\u4ea7\u529b&#xff0c;\u4f46\u4e5f\u628a\u5927\u91cf\u7684\u5e95\u5c42\u63a7\u5236\u903b\u8f91\u9690\u85cf\u5728\u9ed1\u6697\u4e4b\u4e2d\u3002\u770b\u900f\u52a8\u6001\u4ee3\u7406\u5728\u5b57\u8282\u7801\u6307\u4ee4\u5c42\u9762\u7684\u7269\u7406\u65ad\u5d16&#xff0c;\u4e0d\u8ff7\u4fe1\u9ed1\u9b54\u6cd5&#xff0c;\u5584\u7528 TransactionTemplate \u663e\u5f0f\u638c\u63a7\u4e8b\u52a1\u547d\u8fd0&#xff0c;\u4e25\u5b88\u9886\u57df\u804c\u8d23\u7684\u7269\u7406\u5206\u754c&#xff0c;\u8fd9\u624d\u662f\u9876\u7ea7\u67b6\u6784\u5e08\u5b88\u62a4\u5927\u4fc3\u6838\u5fc3\u4ea4\u6613\u5b89\u5168\u7684\u6700\u5f3a\u57fa\u672c\u529f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7ecf\u5386\u4e86\u524d\u4e24\u7bc7\u5173\u4e8e\u201c\u5f02\u5e38\u7c7b\u578b\u541e\u56de\u6eda\u201d\u3001\u201c\u975e public \u4fee\u9970\u7b26\u88ab\u9759\u9ed8\u8df3\u8fc7\u201d\u4ee5\u53ca\u201c\u591a\u6570\u636e\u6e90\u5355\u8fb9\u63d0\u4ea4\u201d\u7684\u6d17\u793c\u4e4b\u540e&#xff0c;\u6211\u4eec\u6765\u5230\u4e86 Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u5931\u6548\u5927\u8d4f\u4e2d\u6700\u5177\u6709\u6b3a\u9a97\u6027\u3001\u4e5f\u6700\u5bb9\u6613\u5728\u8001\u7cfb\u7edf\u91cd\u6784\u65f6\u5f15\u53d1\u91cd\u5927\u8d44\u635f\u4e8b\u6545\u7684\u7ec8\u6781\u5927\u5751\u2014\u2014\u540c\u7c7b\u5185\u90e8\u65b9\u6cd5\u8c03\u7528&#xff08;Self-Invocation&#xff09;\u5bfc\u81f4\u7684\u4ee3\u7406\u5c42\u88ab\u5b8c\u5168\u7ed5\u8fc7\u3002<br \/>\n\u573a\u666f\u662f\u5982\u6b64\u719f\u6089&#xff0c;\u51e0\u4e4e\u6bcf\u4e2a Java \u5de5\u7a0b\u5e08\u7684\u4ee3\u7801\u5e93\u91cc\u90fd\u66fe\u7ecf\u8eba\u8fc7\u7c7b\u4f3c\u7684\u903b\u8f91&#xff1a;\u5728\u67d0\u4e2a\u6838\u5fc3\u7684 OrderTradeS<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,99,101,50,1348],"topic":[],"class_list":["post-117693","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-java","tag-spring","tag-50","tag-1348"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/117693.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u7ecf\u5386\u4e86\u524d\u4e24\u7bc7\u5173\u4e8e\u201c\u5f02\u5e38\u7c7b\u578b\u541e\u56de\u6eda\u201d\u3001\u201c\u975e public \u4fee\u9970\u7b26\u88ab\u9759\u9ed8\u8df3\u8fc7\u201d\u4ee5\u53ca\u201c\u591a\u6570\u636e\u6e90\u5355\u8fb9\u63d0\u4ea4\u201d\u7684\u6d17\u793c\u4e4b\u540e&#xff0c;\u6211\u4eec\u6765\u5230\u4e86 Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u5931\u6548\u5927\u8d4f\u4e2d\u6700\u5177\u6709\u6b3a\u9a97\u6027\u3001\u4e5f\u6700\u5bb9\u6613\u5728\u8001\u7cfb\u7edf\u91cd\u6784\u65f6\u5f15\u53d1\u91cd\u5927\u8d44\u635f\u4e8b\u6545\u7684\u7ec8\u6781\u5927\u5751\u2014\u2014\u540c\u7c7b\u5185\u90e8\u65b9\u6cd5\u8c03\u7528&#xff08;Self-Invocation&#xff09;\u5bfc\u81f4\u7684\u4ee3\u7406\u5c42\u88ab\u5b8c\u5168\u7ed5\u8fc7\u3002 \u573a\u666f\u662f\u5982\u6b64\u719f\u6089&#xff0c;\u51e0\u4e4e\u6bcf\u4e2a Java \u5de5\u7a0b\u5e08\u7684\u4ee3\u7801\u5e93\u91cc\u90fd\u66fe\u7ecf\u8eba\u8fc7\u7c7b\u4f3c\u7684\u903b\u8f91&#xff1a;\u5728\u67d0\u4e2a\u6838\u5fc3\u7684 OrderTradeS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117693.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-24T23:16:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024231628-6add3c4c96039.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117693.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117693.html\",\"name\":\"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-24T23:16:29+00:00\",\"dateModified\":\"2026-10-24T23:16:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117693.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117693.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117693.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/117693.html","og_locale":"zh_CN","og_type":"article","og_title":"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u7ecf\u5386\u4e86\u524d\u4e24\u7bc7\u5173\u4e8e\u201c\u5f02\u5e38\u7c7b\u578b\u541e\u56de\u6eda\u201d\u3001\u201c\u975e public \u4fee\u9970\u7b26\u88ab\u9759\u9ed8\u8df3\u8fc7\u201d\u4ee5\u53ca\u201c\u591a\u6570\u636e\u6e90\u5355\u8fb9\u63d0\u4ea4\u201d\u7684\u6d17\u793c\u4e4b\u540e&#xff0c;\u6211\u4eec\u6765\u5230\u4e86 Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u5931\u6548\u5927\u8d4f\u4e2d\u6700\u5177\u6709\u6b3a\u9a97\u6027\u3001\u4e5f\u6700\u5bb9\u6613\u5728\u8001\u7cfb\u7edf\u91cd\u6784\u65f6\u5f15\u53d1\u91cd\u5927\u8d44\u635f\u4e8b\u6545\u7684\u7ec8\u6781\u5927\u5751\u2014\u2014\u540c\u7c7b\u5185\u90e8\u65b9\u6cd5\u8c03\u7528&#xff08;Self-Invocation&#xff09;\u5bfc\u81f4\u7684\u4ee3\u7406\u5c42\u88ab\u5b8c\u5168\u7ed5\u8fc7\u3002 \u573a\u666f\u662f\u5982\u6b64\u719f\u6089&#xff0c;\u51e0\u4e4e\u6bcf\u4e2a Java \u5de5\u7a0b\u5e08\u7684\u4ee3\u7801\u5e93\u91cc\u90fd\u66fe\u7ecf\u8eba\u8fc7\u7c7b\u4f3c\u7684\u903b\u8f91&#xff1a;\u5728\u67d0\u4e2a\u6838\u5fc3\u7684 OrderTradeS","og_url":"https:\/\/www.wsisp.com\/helps\/117693.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-24T23:16:29+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261024231628-6add3c4c96039.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117693.html","url":"https:\/\/www.wsisp.com\/helps\/117693.html","name":"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-24T23:16:29+00:00","dateModified":"2026-10-24T23:16:29+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117693.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117693.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117693.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Spring \u58f0\u660e\u5f0f\u4e8b\u52a1\u4e03\u5927\u5931\u6548\u573a\u666f\u6df1\u5ea6\u5256\u6790\uff08\u4e09\uff09\uff1a\u540c\u7c7b\u8c03\u7528\u4e0e\u4ee3\u7406\u5931\u6548\u6df1\u5ea6\u590d\u76d8"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=117693"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117693\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117693"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}