{"id":1921,"date":"2023-06-19T18:07:43","date_gmt":"2023-06-19T10:07:43","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1921"},"modified":"2023-07-13T15:45:13","modified_gmt":"2023-07-13T07:45:13","slug":"%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e4%b9%8b%e7%8a%b6%e6%80%81%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f\/%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e4%b9%8b%e7%8a%b6%e6%80%81%e6%a8%a1%e5%bc%8f\/","title":{"rendered":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u6a21\u5f0f"},"content":{"rendered":"<div class='wxsyncmain'>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;text-align: center;margin-top: 0px;margin-bottom: 16px;\"><span style=\"outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;background-color: rgb(255, 255, 255);caret-color: rgba(0, 0, 0, 0.9);font-size: 12px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);visibility: visible;\">\u4e0a\u65b9\u84dd\u8272\u201c<\/span><span style=\"outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;background-color: rgb(255, 255, 255);caret-color: rgb(7, 193, 96);font-size: 12px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);color: rgb(47, 118, 195);visibility: visible;\">\u8001\u6c49\u804a\u6280\u672f<\/span><span style=\"outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;background-color: rgb(255, 255, 255);caret-color: rgba(0, 0, 0, 0.9);font-size: 12px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);visibility: visible;\">\u201d\uff0c\u9009\u62e9\u201c<\/span><span style=\"outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;background-color: rgb(255, 255, 255);caret-color: rgb(7, 193, 96);font-size: 12px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);color: rgb(250, 83, 89);visibility: visible;\">\u8bbe\u4e3a\u661f\u6807<\/span><span style=\"outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;text-align: center;background-color: rgb(255, 255, 255);caret-color: rgba(0, 0, 0, 0.9);font-size: 12px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);visibility: visible;\">\u201d<\/span><\/section>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u72b6\u6001\u8bbe\u8ba1\u6a21\u5f0f\uff08State Pattern\uff09\u662f\u4e00\u79cd\u884c\u4e3a\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u5bf9\u8c61\u5728\u4e0d\u540c\u72b6\u6001\u4e0b\u7684\u884c\u4e3a\u53d8\u5316\u3002\u72b6\u6001\u6a21\u5f0f\u5c06\u5bf9\u8c61\u7684\u884c\u4e3a\u5c01\u88c5\u5728\u4e0d\u540c\u7684\u72b6\u6001\u7c7b\u4e2d\uff0c\u5e76\u901a\u8fc7\u4e0a\u4e0b\u6587\u7c7b\u6765\u7ba1\u7406\u72b6\u6001\u4e4b\u95f4\u7684\u5207\u6362\u3002<\/section>\n<h3 style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-weight: 600;font-size: 1.5em;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;visibility: visible;\"><strong style=\"outline: 0px;visibility: visible;\"><span style=\"outline: 0px;font-size: 24px;color: rgb(47, 118, 195);visibility: visible;\">\u4e00\u3001\u5e94\u7528\u573a\u666f<\/span><\/strong><\/h3>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u72b6\u6001\u6a21\u5f0f\u9002\u7528\u4e8e\u4ee5\u4e0b\u573a\u666f\uff1a<\/section>\n<ol style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\" class=\"list-paddingleft-1\">\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u5f53\u4e00\u4e2a\u5bf9\u8c61\u7684\u884c\u4e3a\u53d6\u51b3\u4e8e\u5176\u5185\u90e8\u72b6\u6001\uff0c\u5e76\u4e14\u9700\u8981\u5728\u8fd0\u884c\u65f6\u6839\u636e\u72b6\u6001\u6539\u53d8\u5176\u884c\u4e3a\u65f6\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u5f53\u4e00\u4e2a\u5bf9\u8c61\u5177\u6709\u5927\u91cf\u7684\u72b6\u6001\uff0c\u5e76\u4e14\u8fd9\u4e9b\u72b6\u6001\u4e4b\u95f4\u7684\u8f6c\u6362\u9891\u7e41\u53d1\u751f\u65f6\uff0c\u4f7f\u7528\u72b6\u6001\u6a21\u5f0f\u53ef\u4ee5\u66f4\u597d\u5730\u7ba1\u7406\u72b6\u6001\u5207\u6362\u903b\u8f91\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-weight: 600;font-size: 1.5em;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;visibility: visible;\"><strong style=\"outline: 0px;visibility: visible;\"><span style=\"outline: 0px;font-size: 24px;color: rgb(47, 118, 195);visibility: visible;\">\u4e8c\u3001\u5b9e\u73b0\u65b9\u5f0f<\/span><\/strong><\/h2>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u72b6\u6001\u6a21\u5f0f\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u89d2\u8272\uff1a<\/section>\n<ol style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\" class=\"list-paddingleft-1\">\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">State\uff08\u72b6\u6001\uff09\uff1a\u5b9a\u4e49\u4e86\u5bf9\u8c61\u7684\u4e00\u4e2a\u72b6\u6001\u63a5\u53e3\uff0c\u5177\u4f53\u72b6\u6001\u7c7b\u5b9e\u73b0\u8be5\u63a5\u53e3\u6765\u5b9a\u4e49\u72b6\u6001\u884c\u4e3a\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">ConcreteState\uff08\u5177\u4f53\u72b6\u6001\uff09\uff1a\u5177\u4f53\u72b6\u6001\u7c7b\u5b9e\u73b0\u4e86\u72b6\u6001\u63a5\u53e3\uff0c\u5b9a\u4e49\u4e86\u5728\u8be5\u72b6\u6001\u4e0b\u5bf9\u8c61\u7684\u884c\u4e3a\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">Context\uff08\u4e0a\u4e0b\u6587\uff09\uff1a\u4e0a\u4e0b\u6587\u7c7b\u6301\u6709\u4e00\u4e2a\u5f53\u524d\u72b6\u6001\u5bf9\u8c61\uff0c\u5e76\u5728\u72b6\u6001\u53d1\u751f\u6539\u53d8\u65f6\u5207\u6362\u5230\u65b0\u7684\u72b6\u6001\u3002<\/section>\n<\/li>\n<\/ol>\n<section style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-weight: 600;font-size: 1.5em;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;visibility: visible;\"><strong style=\"outline: 0px;visibility: visible;\"><span style=\"outline: 0px;font-size: 24px;color: rgb(47, 118, 195);visibility: visible;\">\u4e09\u3001\u4ee3\u7801\u793a\u4f8b<\/span><\/strong><\/section>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u72b6\u6001\u6a21\u5f0f\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u4ee5\u7535\u68af\u4e3a\u4f8b\uff1a<\/section>\n<pre style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\"><section class=\"code-snippet__fix code-snippet__js\"><ul class=\"code-snippet__line-index code-snippet__js\"><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><li><\/li><\/ul><pre class=\"code-snippet__js\" data-lang=\"java\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ State\uff08\u72b6\u6001\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">interface<\/span> <span class=\"code-snippet__title\">ElevatorState<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">open<\/span><span class=\"code-snippet__params\">()<\/span><\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">close<\/span><span class=\"code-snippet__params\">()<\/span><\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span><\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">stop<\/span><span class=\"code-snippet__params\">()<\/span><\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ ConcreteState\uff08\u5177\u4f53\u72b6\u6001\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">OpenState<\/span> <span class=\"code-snippet__keyword\">implements<\/span> <span class=\"code-snippet__title\">ElevatorState<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">open<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u95e8\u5df2\u7ecf\u6253\u5f00\uff0c\u65e0\u9700\u91cd\u590d\u64cd\u4f5c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">close<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u95e8\u5173\u95ed\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u5f00\u59cb\u8fd0\u884c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">stop<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u505c\u6b62\u8fd0\u884c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ ConcreteState\uff08\u5177\u4f53\u72b6\u6001\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">CloseState<\/span> <span class=\"code-snippet__keyword\">implements<\/span> <span class=\"code-snippet__title\">ElevatorState<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">open<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u95e8\u6253\u5f00\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">close<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u95e8\u5df2\u7ecf\u5173\u95ed\uff0c\u65e0\u9700\u91cd\u590d\u64cd\u4f5c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u5f00\u59cb\u8fd0\u884c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">stop<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"\u7535\u68af\u505c\u6b62\u8fd0\u884c\"<\/span>);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ Context\uff08\u4e0a\u4e0b\u6587\uff09<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">Elevator<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__keyword\">private<\/span> ElevatorState currentState;<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__title\">Elevator<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState = <span class=\"code-snippet__keyword\">new<\/span> CloseState();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">setState<\/span><span class=\"code-snippet__params\">(ElevatorState state)<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState = state;<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">open<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState.open();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">close<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState.close();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState.run();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">stop<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        currentState.stop();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__comment\">\/\/ \u793a\u4f8b\u4ee3\u7801<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">Main<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">static<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">main<\/span><span class=\"code-snippet__params\">(String[] args)<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        Elevator elevator = <span class=\"code-snippet__keyword\">new<\/span> Elevator();<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.open();<\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.close();<\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.run();<\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.stop();<\/span><\/code><code><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.setState(<span class=\"code-snippet__keyword\">new<\/span> OpenState());<\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.open();<\/span><\/code><code><span class=\"code-snippet_outer\">        elevator.close();<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<p style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;margin-top: 8px;\">\u5728\u4e0a\u8ff0\u793a\u4f8b\u4e2d\uff0cElevatorState\u662f\u72b6\u6001\u63a5\u53e3\uff0c\u5b9a\u4e49\u4e86\u7535\u68af\u7684\u884c\u4e3a\u65b9\u6cd5\uff0c\u5177\u4f53\u7684\u72b6\u6001\u7c7bOpenState\u548cCloseState\u5b9e\u73b0\u4e86\u8be5\u63a5\u53e3\uff0c\u5206\u522b\u5b9a\u4e49\u4e86\u5728\u6253\u5f00\u548c\u5173\u95ed\u72b6\u6001\u4e0b\u7684\u884c\u4e3a\u3002Elevator\u7c7b\u662f\u4e0a\u4e0b\u6587\u7c7b\uff0c\u6301\u6709\u5f53\u524d\u7684\u72b6\u6001\u5bf9\u8c61\uff0c\u5e76\u5728\u9700\u8981\u65f6\u5207\u6362\u5230\u65b0\u7684\u72b6\u6001\u3002<\/p>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u901a\u8fc7\u8c03\u7528Elevator\u7684\u4e0d\u540c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u89e6\u53d1\u76f8\u5e94\u72b6\u6001\u4e0b\u7684\u884c\u4e3a\u3002\u4f8b\u5982\uff0c\u8c03\u7528open()\u65b9\u6cd5\u4f1a\u6267\u884c\u5f53\u524d\u72b6\u6001\u5bf9\u8c61\u7684open()\u65b9\u6cd5\u3002<\/section>\n<h2 style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-weight: 600;font-size: 1.5em;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;visibility: visible;\"><strong style=\"outline: 0px;visibility: visible;\"><span style=\"outline: 0px;font-size: 24px;color: rgb(47, 118, 195);visibility: visible;\">\u56db\u3001\u4f18\u7f3a\u70b9<\/span><\/strong><\/h2>\n<h2 style=\"margin-bottom: 16px;outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px;font-size: 20px;color: rgb(47, 118, 195);\">\u4f18\u70b9\uff1a<\/span><\/strong><\/h2>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc;\">\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u5c06\u72b6\u6001\u4e0e\u884c\u4e3a\u5c01\u88c5\u5728\u4e0d\u540c\u7684\u72b6\u6001\u7c7b\u4e2d\uff0c\u4f7f\u5f97\u4ee3\u7801\u7ed3\u6784\u66f4\u6e05\u6670\uff0c\u6613\u4e8e\u6269\u5c55\u548c\u7ef4\u62a4\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u5c06\u72b6\u6001\u8f6c\u6362\u903b\u8f91\u96c6\u4e2d\u5728\u4e0a\u4e0b\u6587\u7c7b\u4e2d\uff0c\u4f7f\u5f97\u72b6\u6001\u5207\u6362\u66f4\u52a0\u7075\u6d3b\u548c\u53ef\u63a7\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u7b26\u5408\u5f00\u95ed\u539f\u5219\uff0c\u5f53\u9700\u8981\u589e\u52a0\u65b0\u7684\u72b6\u6001\u65f6\uff0c\u53ea\u9700\u8981\u65b0\u589e\u5bf9\u5e94\u7684\u72b6\u6001\u7c7b\uff0c\u800c\u4e0d\u9700\u8981\u4fee\u6539\u73b0\u6709\u4ee3\u7801\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 16px;margin-bottom: 16px;outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px;font-size: 20px;color: rgb(47, 118, 195);\">\u7f3a\u70b9\uff1a<\/span><\/strong><\/h2>\n<ul class=\"list-paddingleft-1\" style=\"list-style-type: disc;\">\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u589e\u52a0\u4e86\u7c7b\u548c\u5bf9\u8c61\u7684\u6570\u91cf\uff0c\u589e\u52a0\u4e86\u7cfb\u7edf\u7684\u590d\u6742\u5ea6\u3002<\/section>\n<\/li>\n<li style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);\">\n<section style=\"line-height: 1.75em;margin-bottom: 8px;\">\u5982\u679c\u72b6\u6001\u8fc7\u591a\u6216\u72b6\u6001\u4e4b\u95f4\u7684\u8f6c\u6362\u903b\u8f91\u590d\u6742\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4ee3\u7801\u5197\u957f\u548c\u96be\u4ee5\u7ef4\u62a4\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-weight: 600;font-size: 1.5em;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;visibility: visible;\"><strong style=\"outline: 0px;visibility: visible;\"><span style=\"outline: 0px;font-size: 24px;color: rgb(47, 118, 195);visibility: visible;\">\u4e94\u3001\u603b\u7ed3<\/span><\/strong><\/h2>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u72b6\u6001\u8bbe\u8ba1\u6a21\u5f0f\u662f\u4e00\u79cd\u6709\u6548\u7684\u89e3\u51b3\u5bf9\u8c61\u5728\u4e0d\u540c\u72b6\u6001\u4e0b\u884c\u4e3a\u53d8\u5316\u7684\u95ee\u9898\u7684\u8bbe\u8ba1\u6a21\u5f0f\u3002\u5b83\u901a\u8fc7\u5c06\u5bf9\u8c61\u7684\u884c\u4e3a\u5c01\u88c5\u5728\u4e0d\u540c\u7684\u72b6\u6001\u7c7b\u4e2d\uff0c\u5b9e\u73b0\u4e86\u72b6\u6001\u4e0e\u884c\u4e3a\u7684\u89e3\u8026\uff0c\u4f7f\u5f97\u7cfb\u7edf\u66f4\u52a0\u7075\u6d3b\u3001\u53ef\u6269\u5c55\u548c\u6613\u4e8e\u7ef4\u62a4\u3002<\/section>\n<section style=\"border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;margin-bottom: 8px;\">\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5f53\u5bf9\u8c61\u7684\u884c\u4e3a\u53d7\u5230\u591a\u4e2a\u72b6\u6001\u5f71\u54cd\u5e76\u9700\u8981\u6839\u636e\u72b6\u6001\u53d8\u5316\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u72b6\u6001\u8bbe\u8ba1\u6a21\u5f0f\u3002\u901a\u8fc7\u5408\u7406\u8bbe\u8ba1\u72b6\u6001\u63a5\u53e3\u548c\u5177\u4f53\u72b6\u6001\u7c7b\uff0c\u4ee5\u53ca\u4e0a\u4e0b\u6587\u7c7b\u7684\u72b6\u6001\u5207\u6362\u903b\u8f91\uff0c\u53ef\u4ee5\u4f7f\u7cfb\u7edf\u5177\u5907\u66f4\u597d\u7684\u53ef\u8bfb\u6027\u3001\u53ef\u6269\u5c55\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/section>\n<h2 style=\"margin-top: 24px;margin-bottom: 24px;outline: 0px;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);border-width: 0px;border-style: solid;border-color: rgb(217, 217, 227);line-height: 1.75em;\">\n<p style=\"outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: center;\"><span style=\"outline: 0px;font-size: 14px;\"><strong style=\"outline: 0px;color: rgb(0, 0, 0);letter-spacing: 0.578px;\">\u00b7END\u00b7<\/strong><\/span><\/p>\n<p style=\"outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: center;\"><span style=\"outline: 0px;font-size: 14px;\"><br style=\"outline: 0px;\"  \/><\/span><\/p>\n<section style=\"margin-bottom: 8px;outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: center;\"><span style=\"outline: 0px;font-size: 14px;\">\u5982\u559c\u6b22\u672c\u6587\uff0c\u8bf7\u70b9\u51fb\u53f3\u4e0a\u89d2\uff0c\u628a\u6587\u7ae0\u5206\u4eab\u5230\u670b\u53cb\u5708<\/span><\/section>\n<section style=\"margin-bottom: 8px;outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: center;\"><span style=\"outline: 0px;color: rgb(231, 50, 50);font-size: 14px;\">\u82e5\u60f3\u7b2c\u4e00\u65f6\u95f4\u83b7\u53d6\u7cbe\u5f69\uff0c<\/span><span style=\"outline: 0px;color: rgb(231, 50, 50);font-size: 14px;\">\u8bf7\u70b9\u201c\u5728\u770b\u201d\u5e76\u52a0\u201c\u661f\u6807\u201d<\/span><\/section>\n<p style=\"outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: center;\"><br style=\"outline: 0px;\"  \/><\/p>\n<p style=\"outline: 0px;letter-spacing: 0.544px;color: rgb(95, 156, 239);text-align: left;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875558&amp;idx=1&amp;sn=b5e3f4d5f2db018e3299655a13d46f7c&amp;chksm=874a3583b03dbc95413f91e14c62b81967b67ffeb28c8cb58beb35dd12806984412ec221a569&amp;scene=21#wechat_redirect\" textvalue=\"\u5f80\u671f\u56de\u987e\u200d\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" ><span style=\"outline: 0px;color: rgb(0, 0, 0);\"><strong style=\"outline: 0px;\">\u5f80\u671f\u56de\u987e<\/strong><\/span><\/a><\/p>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 1.2em;outline: 0px;color: rgb(95, 156, 239);width: 541.797px;letter-spacing: 0.578px;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875685&amp;idx=1&amp;sn=079cc6f6b3c3c44b439a739f9e98478a&amp;chksm=874a3500b03dbc16f0570324fbbe1bfb0159bd3aea9210009f96248e1670e3166470389a336d&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u89c2\u5bdf\u8005\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >\u89c2\u5bdf\u8005\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875684&amp;idx=1&amp;sn=17231b2194d08e1dcc43388d476266b2&amp;chksm=874a3501b03dbc17da5b801b0ea8b315bbdabb9539c486b52e9f307f5347f86bb6a01566871d&amp;scene=21#wechat_redirect\" textvalue=\"\u4e2d\u4ecb\u8005\u8bbe\u8ba1\u6a21\u200d\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"color: var(--weui-LINK);outline: 0px;cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u5907\u5fd8\u5f55\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875663&amp;idx=1&amp;sn=d2c9c4ac2949031670a12d3b37ffdc23&amp;chksm=874a352ab03dbc3c60155d0e3d75dcc41785b20f6d69f991b048a3be732fc2850d002c532b76&amp;scene=21#wechat_redirect\" textvalue=\"\u4e2d\u4ecb\u8005\u8bbe\u8ba1\u200d\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u4e2d\u4ecb\u8005\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875656&amp;idx=1&amp;sn=b61bfbeea0784deb117022f5968676d9&amp;chksm=874a352db03dbc3b9414f4ef3c4d39f3297ace4ec7091bd1f62850e64b9fe7213a4c580eacb4&amp;scene=21#wechat_redirect\" textvalue=\"\u89e3\u91ca\u5668\u8bbe\u8ba1\u6a21\u5f0f\u200d\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u8fed\u4ee3\u5668\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875641&amp;idx=1&amp;sn=ad3e85a5786ae41b3d507a9773c8edcc&amp;chksm=874a355cb03dbc4a245e4be8185504e9a30579348a677e8d8d870ee76ce0c935cc7f5e647c9f&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u89e3\u91ca\u5668\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u89e3\u91ca\u5668\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875636&amp;idx=1&amp;sn=a4fc092bfec2253bb510b0c478cf3d13&amp;chksm=874a3551b03dbc47a1ddd19cb0f963446510aeaf52d625a362c09e335036b6697f2c58b2d411&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u547d\u4ee4\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u547d\u4ee4\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875622&amp;idx=1&amp;sn=0317b70f7083c09bade5b92c5567e562&amp;chksm=874a3543b03dbc55e28d0877079228658ea8d4b511ac6f9e7baa56df9768f1e4d34c8e903485&amp;scene=21#wechat_redirect\" textvalue=\"\u8d23\u4efb\u94fe\u200d\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u8d23\u4efb\u94fe\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875616&amp;idx=1&amp;sn=4cbba1e1329d0bd5662ed0d6e68fb461&amp;chksm=874a3545b03dbc5371e59201dd15ac46fcfaf8bca53710db27d52aab75f063cc7f93fe4ec47c&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875612&amp;idx=1&amp;sn=c3e86f2cea4b62d5fdd38dac5e21ec00&amp;chksm=874a3579b03dbc6feb926a8142b5a3382b0f7d5bf83aa94a1728b17137b8705c710ba545d99c&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u4eab\u5143\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u4eab\u5143\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875597&amp;idx=1&amp;sn=9353233fb2f60a88fd2ecf3acc9550d5&amp;chksm=874a3568b03dbc7eab64df6f3223b88ff92d4b55711973cca3a6af6e4927c7378db91a1d9c57&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u88c5\u9970\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u5916\u89c2\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875597&amp;idx=1&amp;sn=9353233fb2f60a88fd2ecf3acc9550d5&amp;chksm=874a3568b03dbc7eab64df6f3223b88ff92d4b55711973cca3a6af6e4927c7378db91a1d9c57&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u88c5\u9970\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u88c5\u9970\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875590&amp;idx=1&amp;sn=4518a5ae005a107d47bd40fe508b129f&amp;chksm=874a3563b03dbc759740f34fac27e5285483596ebcd525ab1fd96a2c3a31b20f4ab913b3f90b&amp;scene=21#wechat_redirect\" textvalue=\"\u200d\u7ec4\u5408\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u7ec4\u5408\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875571&amp;idx=1&amp;sn=8bdb0a843d6af1af2ad9909ff27da31f&amp;chksm=874a3596b03dbc80a03bbbc3807c0d84a38066ee12147d800ea7ecfb6f998b5d00f76a9fb83e&amp;scene=21#wechat_redirect\" textvalue=\"\u5efa\u9020\u8005\u200d\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u6865\u63a5\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875571&amp;idx=1&amp;sn=8bdb0a843d6af1af2ad9909ff27da31f&amp;chksm=874a3596b03dbc80a03bbbc3807c0d84a38066ee12147d800ea7ecfb6f998b5d00f76a9fb83e&amp;scene=21#wechat_redirect\" textvalue=\"\u5efa\u9020\u8005\u200d\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u9002\u914d\u5668\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875448&amp;idx=1&amp;sn=17268304894b6bad37f4bd6795fdb5ca&amp;chksm=874a321db03dbb0be016c1da5a6cf60925f8bbeeb20dd0aa2e366aeca2862577a41708f07669&amp;scene=21#wechat_redirect\" textvalue=\"\u5fae\u670d\u52a1\u67b6\u6784-\u8bbe\u8ba1\u603b\u7ed3\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u5efa\u9020\u8005\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875565&amp;idx=1&amp;sn=e9add90720baecdbe12a88b99b0c1a35&amp;chksm=874a3588b03dbc9edf55980f62844307662c323084d1691f452f336a1cc37488d0e5bf350957&amp;scene=21#wechat_redirect\" textvalue=\"\u539f\u578b\u200d\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u539f\u578b\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875528&amp;idx=1&amp;sn=22a8e21c0a2e4f725873d2296be08696&amp;chksm=874a35adb03dbcbb225700a8c2855b57e2ee7cdd0cb9f5cc623e4adef66658762bbbc9622f7b&amp;scene=21#wechat_redirect\" textvalue=\"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u5de5\u5382\u8bbe\u8ba1\u6a21\u5f0f\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u5de5\u5382\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<li style=\"outline: 0px;\">\n<p style=\"outline: 0px;\"><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzA3NzYwNTAwMg==&amp;mid=2649875432&amp;idx=1&amp;sn=5839851b7c73eb027a54db2b0698cc2a&amp;chksm=874a320db03dbb1b779020709a0b8293030f6e206f44fa7c9ffa6402c894b3eb51158e48ef55&amp;scene=21#wechat_redirect\" textvalue=\"\u6570\u636e\u96c6\u6210\u573a\u666f\u4f18\u5316\u2014\u2014\u4efb\u52a1\u7f16\u6392\/\u9650\u6d41\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" hasload=\"1\" style=\"outline: 0px;color: var(--weui-LINK);cursor: pointer;\" rel=\"noopener\" rel=\"nofollow\" >\u5355\u4f8b\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/p>\n<\/li>\n<\/ul>\n<\/h2>\n<section class=\"mp_profile_iframe_wrp\"><mp-common-profile class=\"custom_select_card mp_profile_iframe\" data-pluginname=\"mpprofile\" data-weuitheme=\"light\" data-id=\"MzA3NzYwNTAwMg==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/mmbiz_png\/nrO9icX8gWmEVQATUMPNPhG5ayCNfaFXoqk3ZVvkTMQxKzZPURNLDxb7YbY6GjPAdK9SMf3sIIgaSBib2DJyAPrg\/0?wx_fmt=png\" data-nickname=\"\u8001\u6c49\u804a\u6280\u672f\" data-alias=\"laohaner996\" data-signature=\"\u8001\u53f8\u673a\u6bcf\u5929\u7528\u5fc3\u7684\u4f20\u64ad\u7f16\u7a0b\u7ecf\u9a8c\uff0c\u5206\u4eab\u4f18\u79c0\u7684\u8f6f\u4ef6\u7814\u53d1\u5b66\u4e60\u8d44\u6e90\" data-from=\"0\" data-weui-theme=\"light\"><\/mp-common-profile><\/section>\n<section style=\"margin-bottom: 8px;\">\n<section style=\"display: none;line-height: 1.75em;\"><br  \/><\/section>\n<\/section>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u8001\u6c49\u804a\u6280\u672f              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u65b9\u84dd\u8272\u201c\u8001\u6c49\u804a\u6280\u672f\u201d\uff0c\u9009\u62e9\u201c\u8bbe\u4e3a\u661f\u6807\u201d \u72b6\u6001\u8bbe\u8ba1\u6a21\u5f0f\uff08State Pattern\uff09\u662f\u4e00\u79cd\u884c\u4e3a\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u5bf9\u8c61\u5728\u4e0d\u540c\u72b6\u6001\u4e0b &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[24],"tags":[],"class_list":["post-1921","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-24"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103-300x127.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103-300x127.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528050129103.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"\u8bbe\u8ba1\u6a21\u5f0f","post_date":"2023-06-19","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":309,"next_post_id":3794,"next_post_title":"23\u79cd\u7ecf\u5178\u8bbe\u8ba1\u6a21\u5f0f-\u5de5\u5382\u6a21\u5f0f\uff08\u8be6\u89e3\uff09","previous_post_id":1927,"previous_post_title":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u5de5\u5382\u8bbe\u8ba1\u6a21\u5f0f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1921"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1921\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1920"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}