{"id":122882,"date":"2026-11-05T23:40:42","date_gmt":"2026-11-05T15:40:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/122882.html"},"modified":"2026-11-05T23:40:42","modified_gmt":"2026-11-05T15:40:42","slug":"%e5%a4%9a%e5%b9%b3%e5%8f%b0%e7%94%b5%e5%95%86%e8%ae%a2%e5%8d%95%e8%81%9a%e5%90%88%e7%b3%bb%e7%bb%9f%e6%9e%b6%e6%9e%84%e8%ae%be%e8%ae%a1%ef%bc%9a%e4%bb%8e%e5%a4%a9%e7%8c%ab%e6%8b%bc%e5%a4%9a%e5%a4%9a","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/122882.html","title":{"rendered":"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<p>\u67d0\u6bcd\u5a74\u7535\u5546\u65e5\u57474000\u5355\u3001\u6a2a\u8de86\u5e73\u53f0\u7684\u8ba2\u5355\u805a\u5408\u5b9e\u6218\u590d\u76d8&#xff0c;\u6db5\u76d6API\u7f51\u5173\u3001\u5e42\u7b49\u6027\u8bbe\u8ba1\u3001\u5e93\u5b58\u9632\u8d85\u5356\u7b49\u6838\u5fc3\u73af\u8282<\/p>\n<p>\u505a\u7535\u5546\u7684\u90fd\u77e5\u9053&#xff0c;\u540c\u65f6\u5728\u5929\u732b\u3001\u62fc\u591a\u591a\u3001\u6296\u97f3\u3001\u4eac\u4e1c\u51e0\u4e2a\u5e73\u53f0\u5f00\u5e97\u5df2\u7ecf\u662f\u5e38\u6001\u3002\u4f46\u8ba2\u5355\u4ece\u5404\u4e2a\u6e20\u9053\u6d8c\u8fdb\u6765\u4e4b\u540e\u600e\u4e48\u5904\u7406&#xff0c;\u624d\u662f\u771f\u6b63\u7684\u6280\u672f\u96be\u9898\u3002\u8fd9\u7bc7\u6587\u7ae0\u4e0d\u8bb2\u6982\u5ff5&#xff0c;\u76f4\u63a5\u62ff\u7f51\u4e0a\u7ba1\u5bb6\u5a46\u7f51\u5e97ERP\u7684\u771f\u5b9e\u6848\u4f8b\u5f00\u5200\u2014\u2014\u67d0\u6bcd\u5a74\u7535\u5546\u65e5\u57474000\u5355\u3001\u6a2a\u8de86\u4e2a\u5e73\u53f0\u30013\u4e2a\u4ed3\u5e93&#xff0c;\u770b\u770b\u591a\u5e73\u53f0\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u5230\u5e95\u600e\u4e48\u642d\u3002<\/p>\n<h3>\u4e00\u3001\u591a\u5e73\u53f0\u8ba2\u5355\u805a\u5408\u7684\u6838\u5fc3\u6280\u672f\u6311\u6218<\/h3>\n<p>\u5148\u8bf4\u80cc\u666f\u3002\u8fd9\u5bb6\u6bcd\u5a74\u7535\u5546\u5728\u5929\u732b\u3001\u6dd8\u5b9d\u3001\u62fc\u591a\u591a\u3001\u6296\u97f3\u3001\u4eac\u4e1c\u3001\u5feb\u624b6\u4e2a\u5e73\u53f0\u90fd\u6709\u5e97\u94fa&#xff0c;\u6bcf\u5929\u8ba2\u5355\u91cf\u57283500\u52305000\u5355\u4e4b\u95f4\u6ce2\u52a8\u30023\u4e2a\u4ed3\u5e93\u5206\u522b\u8d1f\u8d23\u5976\u7c89\u8f85\u98df\u3001\u7eb8\u5c3f\u88e4\u3001\u7ae5\u88c5\u4e09\u4e2a\u54c1\u7c7b\u3002\u5728\u6ca1\u6709\u805a\u5408\u7cfb\u7edf\u4e4b\u524d&#xff0c;\u6bcf\u4e2a\u5e73\u53f0\u5355\u72ec\u6253\u5355\u3001\u5355\u72ec\u53d1\u8d27&#xff0c;\u5e93\u5b58\u5404\u7ba1\u5404\u7684&#xff0c;\u8d85\u5356\u662f\u5bb6\u5e38\u4fbf\u996d\u3002<\/p>\n<p>\u6280\u672f\u6311\u6218\u4e3b\u8981\u96c6\u4e2d\u5728\u56db\u4e2a\u5c42\u9762&#xff1a;<\/p>\n<li>\u6570\u636e\u5f02\u6784\u6027&#xff1a;\u6bcf\u4e2a\u5e73\u53f0\u7684API\u8ba4\u8bc1\u65b9\u5f0f\u4e0d\u540c&#xff08;OAuth 2.0\u3001App Key\/Secret\u3001Token\u5237\u65b0\u673a\u5236\u5404\u5f02&#xff09;&#xff0c;\u8fd4\u56de\u7684\u8ba2\u5355\u5b57\u6bb5\u547d\u540d\u548c\u7ed3\u6784\u4e5f\u4e0d\u7edf\u4e00\u3002\u6bd4\u5982\u6dd8\u5b9d\u7528tid\u6807\u8bc6\u8ba2\u5355\u53f7&#xff0c;\u4eac\u4e1c\u7528orderId&#xff0c;\u6296\u97f3\u7528order_id&#xff0c;\u62fc\u591a\u591a\u7528order_sn\u3002<\/li>\n<li>\u72b6\u6001\u673a\u5dee\u5f02&#xff1a;\u5404\u5e73\u53f0\u7684\u8ba2\u5355\u72b6\u6001\u5b9a\u4e49\u4e0d\u4e00\u81f4\u3002\u6dd8\u5b9d\u7684&#034;\u5df2\u53d1\u8d27&#034;\u548c\u4eac\u4e1c\u7684&#034;\u7b49\u5f85\u51fa\u5e93&#034;\u5728\u4e1a\u52a1\u8bed\u4e49\u4e0a\u63a5\u8fd1&#xff0c;\u4f46\u5b57\u6bb5\u503c\u548c\u6d41\u8f6c\u903b\u8f91\u5b8c\u5168\u4e0d\u540c\u3002<\/li>\n<li>\u5e93\u5b58\u4e00\u81f4\u6027&#xff1a;\u540c\u4e00SKU\u5728\u591a\u4e2a\u5e73\u53f0\u5171\u4eab\u5e93\u5b58\u65f6&#xff0c;\u9700\u8981\u4fdd\u8bc1\u6263\u51cf\u7684\u539f\u5b50\u6027\u548c\u5b9e\u65f6\u6027\u3002\u7f51\u7edc\u5ef6\u8fdf\u3001\u5e76\u53d1\u8bf7\u6c42\u3001\u5e73\u53f0\u56de\u8c03\u987a\u5e8f\u90fd\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e0d\u4e00\u81f4\u3002<\/li>\n<li>\u5e76\u53d1\u4e0e\u9650\u6d41&#xff1a;\u5927\u4fc3\u671f\u95f4&#xff08;\u5982618\u3001\u53cc11&#xff09;&#xff0c;\u5404\u5e73\u53f0API\u7684\u8c03\u7528\u9891\u7387\u9650\u5236\u4e0d\u540c&#xff0c;\u9700\u8981\u5728\u9650\u6d41\u7a97\u53e3\u5185\u5b8c\u6210\u8ba2\u5355\u62c9\u53d6\u548c\u72b6\u6001\u540c\u6b65\u3002<\/li>\n<h3>\u4e8c\u3001API\u7f51\u5173\u8bbe\u8ba1\u4e0e\u5e73\u53f0\u9002\u914d\u5c42<\/h3>\n<p>\u67b6\u6784\u7684\u7b2c\u4e00\u5c42\u662fAPI\u7f51\u5173&#xff0c;\u8d1f\u8d23\u7edf\u4e00\u7ba1\u7406\u6240\u6709\u5e73\u53f0\u7684\u63a5\u53e3\u8c03\u7528\u3002\u6bcf\u4e2a\u5e73\u53f0\u9700\u8981\u4e00\u4e2a\u9002\u914d\u5668&#xff08;Adapter&#xff09;&#xff0c;\u5c06\u5e73\u53f0\u7279\u6709\u7684\u6570\u636e\u683c\u5f0f\u8f6c\u6362\u4e3a\u5185\u90e8\u7edf\u4e00\u6a21\u578b\u3002<\/p>\n<table>\n<tbody>\n<tr>\u5e73\u53f0API\u534f\u8bae\u8ba4\u8bc1\u65b9\u5f0f\u9650\u6d41\u89c4\u5219\u8ba2\u5355\u63a8\u9001\u65b9\u5f0f\u7b7e\u540d\u7b97\u6cd5<\/tr>\n<tr>\n<td>\u5929\u732b\/\u6dd8\u5b9d<\/td>\n<td>REST HTTPS<\/td>\n<td>OAuth 2.0 &#043; App Key<\/td>\n<td>40\u6b21\/\u79d2<\/td>\n<td>\u4e3b\u52a8\u62c9\u53d6<\/td>\n<td>HMAC-MD5<\/td>\n<\/tr>\n<tr>\n<td>\u62fc\u591a\u591a<\/td>\n<td>REST HTTPS<\/td>\n<td>Access Token<\/td>\n<td>20\u6b21\/\u79d2<\/td>\n<td>\u6d88\u606f\u63a8\u9001 &#043; \u62c9\u53d6<\/td>\n<td>MD5\u7b7e\u540d<\/td>\n<\/tr>\n<tr>\n<td>\u6296\u97f3\u7535\u5546<\/td>\n<td>REST HTTPS<\/td>\n<td>App Key &#043; Secret<\/td>\n<td>30\u6b21\/\u79d2<\/td>\n<td>\u6d88\u606f\u63a8\u9001<\/td>\n<td>HMAC-SHA256<\/td>\n<\/tr>\n<tr>\n<td>\u4eac\u4e1c<\/td>\n<td>REST HTTPS<\/td>\n<td>OAuth 2.0<\/td>\n<td>30\u6b21\/\u79d2<\/td>\n<td>\u4e3b\u52a8\u62c9\u53d6<\/td>\n<td>MD5\u7b7e\u540d<\/td>\n<\/tr>\n<tr>\n<td>\u5feb\u624b<\/td>\n<td>REST HTTPS<\/td>\n<td>Access Token<\/td>\n<td>10\u6b21\/\u79d2<\/td>\n<td>\u6d88\u606f\u63a8\u9001<\/td>\n<td>HMAC-SHA256<\/td>\n<\/tr>\n<tr>\n<td>\u5c0f\u7ea2\u4e66<\/td>\n<td>REST HTTPS<\/td>\n<td>App Key &#043; Secret<\/td>\n<td>15\u6b21\/\u79d2<\/td>\n<td>\u4e3b\u52a8\u62c9\u53d6<\/td>\n<td>RSA-SHA256<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u9002\u914d\u5668\u6a21\u5f0f\u7684\u6838\u5fc3\u601d\u8def\u662f\u8ba9\u4e0a\u5c42\u4e1a\u52a1\u4ee3\u7801\u53ea\u5173\u5fc3\u7edf\u4e00\u7684\u8ba2\u5355\u6a21\u578b&#xff0c;\u4e0d\u611f\u77e5\u5e73\u53f0\u5dee\u5f02\u3002\u4f2a\u4ee3\u7801\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>interface PlatformAdapter {<br \/>\n    \/\/ \u62c9\u53d6\u6307\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u65b0\u8ba2\u5355<br \/>\n    List&lt;StandardOrder&gt; fetchOrders(DateRange range);<br \/>\n    \/\/ \u6839\u636e\u5e73\u53f0\u8ba2\u5355\u53f7\u67e5\u8be2\u8be6\u60c5<br \/>\n    StandardOrder getOrderDetail(String platformOrderId);<br \/>\n    \/\/ \u540c\u6b65\u53d1\u8d27\u72b6\u6001\u5230\u5e73\u53f0<br \/>\n    boolean syncLogistics(String platformOrderId, LogisticsInfo info);<br \/>\n    \/\/ \u83b7\u53d6\u5e73\u53f0\u9650\u6d41\u914d\u7f6e<br \/>\n    RateLimitConfig getRateLimit();<br \/>\n}<\/p>\n<p>\/\/ \u4ee5\u6dd8\u5b9d\u9002\u914d\u5668\u4e3a\u4f8b<br \/>\nclass TaobaoAdapter implements PlatformAdapter {<br \/>\n    private String appKey;<br \/>\n    private String appSecret;<br \/>\n    private String sessionKey;<\/p>\n<p>    &#064;Override<br \/>\n    public List&lt;StandardOrder&gt; fetchOrders(DateRange range) {<br \/>\n        \/\/ \u8c03\u7528 taobao.trades.sold.get \u63a5\u53e3<br \/>\n        \/\/ \u5c06 Trade \u5bf9\u8c61\u8f6c\u6362\u4e3a StandardOrder<br \/>\n        TaobaoTradeResponse resp &#061; apiClient.getTradesSold(<br \/>\n            appKey, sessionKey, range.getStart(), range.getEnd()<br \/>\n        );<br \/>\n        return resp.getTrades().stream()<br \/>\n            .map(this::convertToStandard)<br \/>\n            .collect(Collectors.toList());<br \/>\n    }<br \/>\n}<\/p>\n<h3>\u4e09\u3001\u8ba2\u5355\u540c\u6b65\u6838\u5fc3\u4ee3\u7801\u5b9e\u73b0<\/h3>\n<p>\u8ba2\u5355\u540c\u6b65\u7684\u5173\u952e\u5728\u4e8e&#xff1a;\u5e42\u7b49\u5199\u5165 &#043; \u4e8b\u52a1\u4e00\u81f4\u6027\u3002\u540c\u4e00\u6761\u8ba2\u5355\u53ef\u80fd\u56e0\u4e3a\u7f51\u7edc\u91cd\u8bd5\u88ab\u63a8\u9001\u591a\u6b21&#xff0c;\u5fc5\u987b\u4fdd\u8bc1\u4e0d\u91cd\u590d\u5165\u5e93\u3002<\/p>\n<p>&#8212; \u8ba2\u5355\u4e3b\u8868\u7ed3\u6784&#xff08;MySQL 8.0&#xff09;<br \/>\nCREATE TABLE orders (<br \/>\n    id BIGINT PRIMARY KEY AUTO_INCREMENT,<br \/>\n    platform VARCHAR(32) NOT NULL COMMENT &#039;\u5e73\u53f0\u6807\u8bc6: taobao\/pdd\/douyin\/jd\/ks\/xhs&#039;,<br \/>\n    platform_order_id VARCHAR(64) NOT NULL COMMENT &#039;\u5e73\u53f0\u539f\u59cb\u8ba2\u5355\u53f7&#039;,<br \/>\n    order_status TINYINT DEFAULT 0 COMMENT &#039;0-\u5f85\u4ed8\u6b3e 1-\u5df2\u4ed8\u6b3e 2-\u5df2\u53d1\u8d27 3-\u5df2\u5b8c\u6210 4-\u5df2\u53d6\u6d88&#039;,<br \/>\n    buyer_name VARCHAR(64),<br \/>\n    buyer_phone VARCHAR(20),<br \/>\n    total_amount DECIMAL(12,2) NOT NULL,<br \/>\n    discount_amount DECIMAL(12,2) DEFAULT 0.00,<br \/>\n    warehouse_id INT NOT NULL COMMENT &#039;\u53d1\u8d27\u4ed3\u5e93ID&#039;,<br \/>\n    sync_time DATETIME DEFAULT CURRENT_TIMESTAMP,<br \/>\n    update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,<br \/>\n    UNIQUE KEY uk_platform_order (platform, platform_order_id),<br \/>\n    INDEX idx_status_time (order_status, sync_time),<br \/>\n    INDEX idx_warehouse (warehouse_id)<br \/>\n) ENGINE&#061;InnoDB DEFAULT CHARSET&#061;utf8mb4;<\/p>\n<p>\u540c\u6b65\u670d\u52a1\u7684\u6838\u5fc3\u903b\u8f91&#xff08;Java\u4f2a\u4ee3\u7801&#xff09;&#xff1a;<\/p>\n<p>&#064;Transactional(rollbackFor &#061; Exception.class)<br \/>\npublic SyncResult syncOrder(StandardOrder order) {<br \/>\n    \/\/ 1. \u5e42\u7b49\u6027\u68c0\u67e5&#xff1a;\u5229\u7528\u552f\u4e00\u7d22\u5f15\u9632\u91cd<br \/>\n    Orders existing &#061; orderMapper.selectByPlatformAndId(<br \/>\n        order.getPlatform(), order.getPlatformOrderId()<br \/>\n    );<br \/>\n    if (existing !&#061; null) {<br \/>\n        \/\/ \u5df2\u5b58\u5728\u5219\u66f4\u65b0\u72b6\u6001&#xff08;\u5904\u7406\u72b6\u6001\u53d8\u66f4\u573a\u666f&#xff09;<br \/>\n        if (existing.getOrderStatus() !&#061; order.getStatus()) {<br \/>\n            orderMapper.updateStatus(existing.getId(), order.getStatus());<br \/>\n        }<br \/>\n        return SyncResult.SKIPPED;<br \/>\n    }<br \/>\n    \/\/ 2. \u5199\u5165\u65b0\u8ba2\u5355<br \/>\n    Orders newOrder &#061; convertToEntity(order);<br \/>\n    orderMapper.insert(newOrder);<br \/>\n    \/\/ 3. \u5199\u5165\u8ba2\u5355\u660e\u7ec6<br \/>\n    for (OrderItem item : order.getItems()) {<br \/>\n        orderItemMapper.insert(convertToItemEntity(item, newOrder.getId()));<br \/>\n    }<br \/>\n    \/\/ 4. \u53d1\u9001MQ\u6d88\u606f\u901a\u77e5\u4e0b\u6e38&#xff08;\u5e93\u5b58\u6263\u51cf\u3001\u7269\u6d41\u5206\u914d\u7b49&#xff09;<br \/>\n    messageProducer.send(&#034;order_sync_topic&#034;, newOrder.getId());<br \/>\n    return SyncResult.SUCCESS;<br \/>\n}<\/p>\n<h3>\u56db\u3001\u5e93\u5b58\u4e00\u81f4\u6027\u4fdd\u969c&#xff1a;\u5e42\u7b49\u6027\u8bbe\u8ba1\u4e0e\u9632\u8d85\u5356<\/h3>\n<p>\u591a\u5e73\u53f0\u5171\u4eab\u5e93\u5b58\u662f\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u4e2d\u6700\u5bb9\u6613\u51fa\u95ee\u9898\u7684\u73af\u8282\u3002\u6838\u5fc3\u539f\u5219&#xff1a;\u6240\u6709\u5e93\u5b58\u53d8\u52a8\u5fc5\u987b\u662f\u539f\u5b50\u64cd\u4f5c&#xff0c;\u4e14\u652f\u6301\u5e42\u7b49\u91cd\u8bd5\u3002<\/p>\n<p>&#8212; \u5e93\u5b58\u8868&#xff08;\u5e26\u7248\u672c\u53f7&#xff0c;\u652f\u6301\u4e50\u89c2\u9501&#xff09;<br \/>\nCREATE TABLE inventory (<br \/>\n    sku_id VARCHAR(64) PRIMARY KEY,<br \/>\n    sku_name VARCHAR(128) NOT NULL,<br \/>\n    warehouse_id INT NOT NULL,<br \/>\n    total_stock INT DEFAULT 0 COMMENT &#039;\u603b\u5e93\u5b58&#039;,<br \/>\n    locked_stock INT DEFAULT 0 COMMENT &#039;\u9501\u5b9a\u5e93\u5b58(\u5df2\u4e0b\u5355\u672a\u53d1\u8d27)&#039;,<br \/>\n    available_stock INT GENERATED ALWAYS AS (total_stock &#8211; locked_stock) STORED,<br \/>\n    version INT DEFAULT 0 COMMENT &#039;\u4e50\u89c2\u9501\u7248\u672c\u53f7&#039;,<br \/>\n    update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,<br \/>\n    INDEX idx_warehouse_sku (warehouse_id, sku_id)<br \/>\n) ENGINE&#061;InnoDB DEFAULT CHARSET&#061;utf8mb4;<\/p>\n<p>&#8212; \u6263\u51cf\u5e93\u5b58&#xff08;\u539f\u5b50\u64cd\u4f5c &#043; \u4e50\u89c2\u9501&#xff09;<br \/>\n&#8212; \u5148\u9501\u5b9a\u5e93\u5b58<br \/>\nUPDATE inventory<br \/>\nSET locked_stock &#061; locked_stock &#043; #{qty},<br \/>\n    version &#061; version &#043; 1<br \/>\nWHERE sku_id &#061; #{skuId}<br \/>\n  AND warehouse_id &#061; #{warehouseId}<br \/>\n  AND (total_stock &#8211; locked_stock) &gt;&#061; #{qty}<br \/>\n  AND version &#061; #{version};<\/p>\n<p>\u5bf9\u4e8e\u5df2\u7ecf\u4e0b\u5355\u4f46\u5c1a\u672a\u53d1\u8d27\u7684\u8ba2\u5355&#xff0c;\u4f7f\u7528Redis\u505a\u5e42\u7b49\u6027\u6821\u9a8c&#xff1a;<\/p>\n<p>\/\/ Redis\u5e42\u7b49\u6027\u6821\u9a8c&#xff08;\u9632\u6b62\u91cd\u590d\u6263\u51cf&#xff09;<br \/>\npublic boolean tryLockStock(String platform, String orderId, String skuId, int qty) {<br \/>\n    String idempotentKey &#061; &#034;stock:lock:&#034; &#043; platform &#043; &#034;:&#034; &#043; orderId;<br \/>\n    \/\/ SET NX \u4fdd\u8bc1\u53ea\u6267\u884c\u4e00\u6b21&#xff0c;\u8fc7\u671f\u65f6\u95f424\u5c0f\u65f6<br \/>\n    Boolean acquired &#061; redisTemplate.opsForValue()<br \/>\n        .setIfAbsent(idempotentKey, skuId &#043; &#034;:&#034; &#043; qty, Duration.ofHours(24));<br \/>\n    if (Boolean.FALSE.equals(acquired)) {<br \/>\n        log.warn(&#034;\u91cd\u590d\u8bf7\u6c42\u88ab\u62e6\u622a, key&#061;{}&#034;, idempotentKey);<br \/>\n        return false;<br \/>\n    }<br \/>\n    \/\/ \u6267\u884c\u5b9e\u9645\u5e93\u5b58\u6263\u51cf<br \/>\n    int affected &#061; inventoryMapper.lockStock(skuId, qty);<br \/>\n    if (affected &#061;&#061; 0) {<br \/>\n        redisTemplate.delete(idempotentKey); \/\/ \u6263\u51cf\u5931\u8d25\u5219\u91ca\u653e\u5e42\u7b49\u952e<br \/>\n        return false;<br \/>\n    }<br \/>\n    return true;<br \/>\n}<\/p>\n<h3>\u4e94\u3001\u5f02\u5e38\u5904\u7406\u4e0e\u91cd\u8bd5\u673a\u5236<\/h3>\n<p>\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u5f02\u5e38\u662f\u5e38\u6001\u3002\u8ba2\u5355\u540c\u6b65\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u5f02\u5e38\u7c7b\u578b\u548c\u5904\u7406\u7b56\u7565&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u5f02\u5e38\u7c7b\u578b\u89e6\u53d1\u573a\u666f\u5904\u7406\u7b56\u7565\u91cd\u8bd5\u65b9\u5f0f\u6700\u5927\u91cd\u8bd5\u6b21\u6570<\/tr>\n<tr>\n<td>\u7f51\u7edc\u8d85\u65f6<\/td>\n<td>\u8c03\u7528\u5e73\u53f0API\u8d85\u65f6<\/td>\n<td>\u6307\u6570\u9000\u907f\u91cd\u8bd5<\/td>\n<td>1s \u2192 2s \u2192 4s \u2192 8s<\/td>\n<td>5\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u9650\u6d41\u62e6\u622a<\/td>\n<td>\u8d85\u8fc7\u5e73\u53f0QPS\u9650\u5236<\/td>\n<td>\u964d\u901f &#043; \u5ef6\u8fdf\u961f\u5217<\/td>\n<td>\u6309\u9650\u6d41\u7a97\u53e3\u7b49\u5f85<\/td>\n<td>\u65e0\u9650&#xff08;\u8fdb\u5165\u6162\u961f\u5217&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u7b7e\u540d\u6821\u9a8c\u5931\u8d25<\/td>\n<td>Token\u8fc7\u671f\u6216\u5bc6\u94a5\u9519\u8bef<\/td>\n<td>\u5237\u65b0Token\u540e\u91cd\u8bd5<\/td>\n<td>\u81ea\u52a8\u5237\u65b01\u6b21<\/td>\n<td>1\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u683c\u5f0f\u5f02\u5e38<\/td>\n<td>\u5e73\u53f0\u8fd4\u56de\u975e\u9884\u671f\u5b57\u6bb5<\/td>\n<td>\u8bb0\u5f55\u65e5\u5fd7 &#043; \u4eba\u5de5\u5904\u7406<\/td>\n<td>\u4e0d\u91cd\u8bd5&#xff0c;\u8fdb\u6b7b\u4fe1\u961f\u5217<\/td>\n<td>0\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u5e93\u5b58\u4e0d\u8db3<\/td>\n<td>\u53ef\u7528\u5e93\u5b58 &lt; \u8ba2\u5355\u6570\u91cf<\/td>\n<td>\u6807\u8bb0\u7f3a\u8d27 &#043; \u901a\u77e5\u8fd0\u8425<\/td>\n<td>\u4e0d\u91cd\u8bd5<\/td>\n<td>0\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u6570\u636e\u5e93\u6b7b\u9501<\/td>\n<td>\u5e76\u53d1\u66f4\u65b0\u540c\u4e00SKU\u5e93\u5b58<\/td>\n<td>\u4e8b\u52a1\u56de\u6eda\u540e\u91cd\u8bd5<\/td>\n<td>\u968f\u673a\u5ef6\u8fdf0.5-2s<\/td>\n<td>3\u6b21<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u91cd\u8bd5\u673a\u5236\u7684\u5173\u952e\u8bbe\u8ba1&#xff1a;\u6240\u6709\u91cd\u8bd5\u64cd\u4f5c\u5fc5\u987b\u643a\u5e26\u5e42\u7b49\u952e&#xff0c;\u786e\u4fdd\u540c\u4e00\u7b14\u8ba2\u5355\u7684\u5e93\u5b58\u6263\u51cf\u4e0d\u4f1a\u88ab\u6267\u884c\u4e24\u6b21\u3002\u6b7b\u4fe1\u961f\u5217\u4e2d\u7684\u5f02\u5e38\u8ba2\u5355\u4f1a\u8fdb\u5165\u4eba\u5de5\u5904\u7406\u9762\u677f&#xff0c;\u8fd0\u8425\u4eba\u5458\u53ef\u4ee5\u67e5\u770b\u5b8c\u6574\u7684\u9519\u8bef\u5806\u6808\u548c\u4e0a\u4e0b\u6587\u4fe1\u606f\u3002<\/p>\n<h3>\u516d\u3001\u6027\u80fd\u6570\u636e\u4e0e\u538b\u6d4b\u7ed3\u679c<\/h3>\n<p>\u7cfb\u7edf\u6280\u672f\u6808&#xff1a;Spring Boot &#043; Kafka &#043; Redis Cluster &#043; MySQL 8.0&#xff08;\u8bfb\u5199\u5206\u79bb&#xff09;&#xff0c;\u90e8\u7f72\u5728\u963f\u91cc\u4e91ECS\u96c6\u7fa4\u4e0a\u3002\u4ee5\u4e0b\u662f2024\u5e743\u6708\u538b\u6d4b\u62a5\u544a\u7684\u6838\u5fc3\u6307\u6807&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u6d4b\u8bd5\u573a\u666f\u5e76\u53d1\u6570QPS\u5e73\u5747\u54cd\u5e94\u65f6\u95f4P99\u5ef6\u8fdf\u9519\u8bef\u7387<\/tr>\n<tr>\n<td>\u8ba2\u5355\u540c\u6b65\u5199\u5165<\/td>\n<td>200<\/td>\n<td>3,200<\/td>\n<td>52ms<\/td>\n<td>180ms<\/td>\n<td>0.01%<\/td>\n<\/tr>\n<tr>\n<td>\u5e93\u5b58\u67e5\u8be2&#xff08;Redis\u7f13\u5b58\u547d\u4e2d&#xff09;<\/td>\n<td>500<\/td>\n<td>12,000<\/td>\n<td>8ms<\/td>\n<td>25ms<\/td>\n<td>0%<\/td>\n<\/tr>\n<tr>\n<td>\u5e93\u5b58\u6263\u51cf&#xff08;\u542b\u4e50\u89c2\u9501&#xff09;<\/td>\n<td>300<\/td>\n<td>4,500<\/td>\n<td>35ms<\/td>\n<td>120ms<\/td>\n<td>0.02%<\/td>\n<\/tr>\n<tr>\n<td>\u7269\u6d41\u72b6\u6001\u56de\u4f20<\/td>\n<td>100<\/td>\n<td>1,800<\/td>\n<td>95ms<\/td>\n<td>280ms<\/td>\n<td>0.05%<\/td>\n<\/tr>\n<tr>\n<td>\u6df7\u5408\u573a\u666f&#xff08;\u8bfb\u51997:3&#xff09;<\/td>\n<td>500<\/td>\n<td>8,500<\/td>\n<td>42ms<\/td>\n<td>150ms<\/td>\n<td>0.03%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u6a21\u62df618\u5927\u4fc3\u6d41\u91cf&#xff08;\u5cf0\u503cQPS\u4e3a\u65e5\u5e38\u76845\u500d&#xff09;\u7684\u538b\u6d4b\u4e2d&#xff0c;\u7cfb\u7edf\u6574\u4f53\u8868\u73b0\u7a33\u5b9a\u3002\u8ba2\u5355\u540c\u6b65\u670d\u52a1\u901a\u8fc7Kafka\u5206\u533a\u6269\u5c55\u5b9e\u73b0\u4e86\u6c34\u5e73\u6269\u5bb9&#xff0c;\u5e93\u5b58\u670d\u52a1\u901a\u8fc7MySQL\u5206\u5e93\u5206\u8868&#xff08;\u6309warehouse_id\u5206\u7247&#xff09;\u7a81\u7834\u4e86\u5355\u673a\u6027\u80fd\u74f6\u9888\u3002<\/p>\n<p>\u5173\u4e8e\u5e73\u53f0\u63a5\u5165\u7684\u6269\u5c55\u6027&#xff1a;\u7f51\u4e0a\u7ba1\u5bb6\u5a46\u5df2\u7d2f\u8ba1\u5bf9\u63a5130&#043;\u7535\u5546\u5e73\u53f0&#xff0c;\u65b0\u5e73\u53f0\u63a5\u5165\u901a\u8fc7\u5b9e\u73b0PlatformAdapter\u63a5\u53e3\u5373\u53ef\u5b8c\u6210&#xff0c;\u5e73\u5747\u5f00\u53d1\u5468\u671f\u7ea61-2\u5468\u3002<\/p>\n<h3>\u4e03\u3001\u67b6\u6784\u603b\u7ed3\u4e0e\u6269\u5c55\u5efa\u8bae<\/h3>\n<p>\u591a\u5e73\u53f0\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u7684\u6838\u5fc3\u8bbe\u8ba1\u539f\u5219\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u4e09\u70b9&#xff1a;<\/p>\n<li>\u5e73\u53f0\u5dee\u5f02\u9694\u79bb\u5728\u9002\u914d\u5c42&#xff1a;\u6838\u5fc3\u4e1a\u52a1\u903b\u8f91\u53ea\u5904\u7406\u6807\u51c6\u8ba2\u5355\u6a21\u578b&#xff0c;\u4e0d\u611f\u77e5\u5177\u4f53\u5e73\u53f0\u3002\u65b0\u5e73\u53f0\u63a5\u5165\u4e0d\u5f71\u54cd\u5df2\u6709\u903b\u8f91\u3002<\/li>\n<li>\u5e42\u7b49\u6027\u8d2f\u7a7f\u5168\u94fe\u8def&#xff1a;\u4ece\u8ba2\u5355\u5199\u5165\u5230\u5e93\u5b58\u6263\u51cf\u5230\u7269\u6d41\u56de\u4f20&#xff0c;\u6bcf\u4e00\u6b65\u90fd\u652f\u6301\u5e42\u7b49\u91cd\u8bd5&#xff0c;\u8fd9\u662f\u5206\u5e03\u5f0f\u7cfb\u7edf\u53ef\u9760\u6027\u7684\u57fa\u7840\u3002<\/li>\n<li>\u5f02\u6b65\u5316 &#043; \u6700\u7ec8\u4e00\u81f4\u6027&#xff1a;\u901a\u8fc7Kafka\u6d88\u606f\u961f\u5217\u89e3\u8026\u540c\u6b65\u548c\u540e\u7eed\u5904\u7406&#xff0c;\u7528\u6700\u7ec8\u4e00\u81f4\u6027\u66ff\u4ee3\u5f3a\u4e00\u81f4\u6027&#xff0c;\u6362\u53d6\u66f4\u9ad8\u7684\u541e\u5410\u91cf\u548c\u53ef\u7528\u6027\u3002<\/li>\n<p>\u5bf9\u4e8e\u65e5\u8ba2\u5355\u91cf\u57285000\u5355\u4ee5\u4e0b\u7684\u4e2d\u5c0f\u7535\u5546\u4f01\u4e1a&#xff0c;\u5efa\u8bae\u4f18\u5148\u6253\u901a\u4e3b\u6d41\u7a0b&#xff08;\u8ba2\u5355\u62c9\u53d6 \u2192 \u5e93\u5b58\u6263\u51cf \u2192 \u53d1\u8d27\u56de\u4f20&#xff09;&#xff0c;\u4e0d\u5fc5\u4e00\u5f00\u59cb\u5c31\u8ffd\u6c42\u5168\u94fe\u8def\u81ea\u52a8\u5316\u3002\u5148\u628a\u6570\u636e\u8dd1\u901a\u3001\u628a\u5f02\u5e38\u5904\u7406\u597d&#xff0c;\u518d\u9010\u6b65\u53e0\u52a0\u667a\u80fd\u5206\u4ed3\u3001\u81ea\u52a8\u62c6\u5355\u7b49\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/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":[183,735,442],"topic":[],"class_list":["post-122882","post","type-post","status-publish","format-standard","hentry","category-server","tag-unity","tag-735","tag-442"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \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\/122882.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/122882.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-05T15:40:42+00:00\" \/>\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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122882.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/122882.html\",\"name\":\"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-05T15:40:42+00:00\",\"dateModified\":\"2026-11-05T15:40:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/122882.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/122882.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/122882.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218\"}]},{\"@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":"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \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\/122882.html","og_locale":"zh_CN","og_type":"article","og_title":"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/122882.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-05T15:40:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/122882.html","url":"https:\/\/www.wsisp.com\/helps\/122882.html","name":"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-05T15:40:42+00:00","dateModified":"2026-11-05T15:40:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/122882.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/122882.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/122882.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u591a\u5e73\u53f0\u7535\u5546\u8ba2\u5355\u805a\u5408\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\uff1a\u4ece\u5929\u732b\u62fc\u591a\u591a\u6296\u97f3\u4eac\u4e1c\u5230\u7edf\u4e00\u5904\u7406\u7684\u6280\u672f\u5b9e\u6218"}]},{"@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\/122882","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=122882"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/122882\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=122882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=122882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=122882"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=122882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}