{"id":3623,"date":"2023-11-21T08:20:17","date_gmt":"2023-11-21T00:20:17","guid":{"rendered":"http:\/\/www.ponybai.com\/?p=3623"},"modified":"2023-11-21T08:20:19","modified_gmt":"2023-11-21T00:20:19","slug":"apex%e6%8e%a7%e5%88%b6%e6%b5%81%e8%af%ad%e5%8f%a5","status":"publish","type":"post","link":"http:\/\/www.ponybai.com\/?p=3623","title":{"rendered":"Apex\u63a7\u5236\u6d41\u8bed\u53e5"},"content":{"rendered":"\n<p>Apex \u63d0\u4f9b\u4e86 if-else \u8bed\u53e5\u3001switch \u8bed\u53e5\u548c\u5faa\u73af\u6765\u63a7\u5236 \u4ee3\u7801\u6267\u884c\u3002\u8bed\u53e5\u901a\u5e38\u6309\u7167\u5b83\u4eec\u51fa\u73b0\u7684\u987a\u5e8f\u9010\u884c\u6267\u884c\u3002 \u4f7f\u7528\u63a7\u5236\u6d41\u8bed\u53e5\uff0c\u53ef\u4ee5\u6839\u636e\u67d0\u4e2a\u6761\u4ef6\u4f7f Apex \u4ee3\u7801\u6267\u884c\uff0c \u6216\u8005\u8ba9\u4ee3\u7801\u5757\u91cd\u590d\u6267\u884c\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6761\u4ef6 \uff08If-else\uff09<\/strong>\u00a0\u8bed\u53e5 Apex \u4e2d\u7684\u6761\u4ef6\u8bed\u53e5<br>\u7684\u5de5\u4f5c\u65b9\u5f0f\u4e0e Java \u7c7b\u4f3c\u3002<\/li>\n\n\n\n<li><strong>Switch<\/strong>\u00a0\u8bed\u53e5 Apex \u63d0\u4f9b\u4e86\u4e00\u4e2a\u8bed\u53e5<br>\uff0c\u7528\u4e8e\u6d4b\u8bd5\u8868\u8fbe\u5f0f\u662f\u5426\u4e0e\u591a\u4e2a\u503c\u4e4b\u4e00\u5339\u914d\uff0c\u5e76\u76f8\u5e94\u5730\u5206\u652f\u3002<samp>switch<\/samp><\/li>\n\n\n\n<li><strong>Loops<\/strong><br>Apex \u652f\u6301\u4e94\u79cd\u7c7b\u578b\u7684\u8fc7\u7a0b\u5faa\u73af\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u6761\u4ef6 \uff08If-else\uff09 \u8bed\u53e5<\/h2>\n\n\n\n<p>Apex \u4e2d\u7684\u6761\u4ef6\u8bed\u53e5\u7684\u5de5\u4f5c\u65b9\u5f0f\u4e0e Java \u7c7b\u4f3c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (&#91;Boolean_condition]) \n    \/\/ Statement 1\nelse\n    \/\/ Statement 2<\/code><\/pre>\n\n\n\n<p>\u8be5\u90e8\u5206\u59cb\u7ec8\u662f\u53ef\u9009\u7684\uff0c\u5e76\u4e14\u59cb\u7ec8\u662f\u53ef\u9009\u7684 \u5177\u6709\u6700\u63a5\u8fd1 .\u4e3a \u4f8b\uff1a<\/p>\n\n\n\n<p><samp>else<\/samp><samp>if<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Integer x, sign;\n\/\/ Your code\nif (x &lt;= 0) if (x == 0) sign = 0; else sign = -1;<\/code><\/pre>\n\n\n\n<p>\u662f \u7b49\u6548 \u81ea\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Integer x, sign;\n\/\/ Your code\nif (x &lt;= 0) {\n    if (x == 0) {\n           sign = 0; \n    } else  {\n           sign = -1;\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u91cd\u590d\u8bed\u53e5\u4e5f\u662f\u5141\u8bb8\u7684\u3002 \u4e3a \u4f8b\uff1a<\/p>\n\n\n\n<p><samp>else&nbsp;if<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (place == 1) {\n    medal_color = 'gold';\n} else if (place == 2) {\n    medal_color = 'silver';\n} else if (place == 3) {\n    medal_color = 'bronze';\n} else {\n    medal_color = null;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Switch \u8bed\u53e5<\/h2>\n\n\n\n<p>Apex \u63d0\u4f9b\u4e86\u4e00\u4e2a\u6d4b\u8bd5 \u8868\u8fbe\u5f0f\u662f\u5426\u4e0e\u591a\u4e2a\u503c\u4e4b\u4e00\u5339\u914d\uff0c\u5e76\u76f8\u5e94\u5730\u8fdb\u884c\u5206\u652f\u3002<\/p>\n\n\n\n<p><samp>switch<\/samp><\/p>\n\n\n\n<p>\u8bed\u6cd5\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on expression {\n    when value1 {\t\t\/\/ when block 1\n        \/\/ code block 1\n    }\t\n    when value2 {\t\t\/\/ when block 2\n        \/\/ code block 2\n    }\n    when value3 {\t\t\/\/ when block 3\n        \/\/ code block 3\n    }\n    when else {\t\t  \/\/ default block, optional\n        \/\/ code block 4\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u8be5\u503c\u53ef\u4ee5\u662f\u5355\u4e2a\u503c\uff0c\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\u503c \u503c\u6216 sObject \u7c7b\u578b\u3002\u4f8b\u5982\uff1a<samp>when<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>when value1 {\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>when value2, value3 {\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>when TypeName VariableName {\n}<\/code><\/pre>\n\n\n\n<p>\u8be5\u8bed\u53e5\u8ba1\u7b97\u8868\u8fbe\u5f0f\u548c \u6267\u884c\u5339\u914d\u503c\u7684\u4ee3\u7801\u5757\u3002\u5982\u679c\u6ca1\u6709\u5339\u914d\u7684\u503c\uff0c\u5219\u4ee3\u7801 \u5757\u88ab\u6267\u884c\u3002\u5982\u679c\u6ca1\u6709\u963b\u6b62\uff0c\u5219\u4e0d\u6267\u884c\u4efb\u4f55\u64cd\u4f5c\u3002<samp>switch<\/samp><samp>when<\/samp><samp>when&nbsp;else<\/samp><samp>when&nbsp;else<\/samp><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u6ca1\u6709\u843d\u5dee\u3002\u6267\u884c\u4ee3\u7801\u5757\u540e\uff0c\u8bed\u53e5\u5c06\u9000\u51fa\u3002<samp>switch<\/samp>Apex \u8bed\u53e5\u8868\u8fbe\u5f0f\u53ef\u4ee5\u662f\u4ee5\u4e0b\u8868\u8fbe\u5f0f\u4e4b\u4e00 \u4ee5\u4e0b\u7c7b\u578b\u3002<\/p>\n\n\n\n<p><samp>switch<\/samp><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6574\u6570<\/li>\n\n\n\n<li>\u957f<\/li>\n\n\n\n<li>s\u5bf9\u8c61<\/li>\n\n\n\n<li>\u5b57\u7b26\u4e32<\/li>\n\n\n\n<li>\u679a\u4e3e<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f53\u963b\u6b62<\/h2>\n\n\n\n<p>\u6bcf\u4e2a\u5757\u90fd\u6709\u4e00\u4e2a\u503c\uff0c\u5373 expression \u662f\u5339\u914d\u7684\u3002\u8fd9\u4e9b\u503c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u5f62\u5f0f\u4e4b\u4e00\u3002<samp>when<\/samp><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>when {} \uff08a when \u5757\u53ef\u4ee5\u6709 \u591a\u4e2a\u9017\u53f7\u5206\u9694\u7684\u6587\u5b57\u5b50\u53e5\uff09<samp>literal<\/samp><\/li>\n\n\n\n<li>\u5f53 SObjectType<samp>identifier<\/samp>&nbsp;{}<\/li>\n\n\n\n<li>\u4ec0\u4e48\u65f6\u5019<samp>enum_value<\/samp>&nbsp;{}<\/li>\n<\/ul>\n\n\n\n<p>\u8be5\u4ef7\u503c\u5bf9\u6240\u6709\u4eba\u6765\u8bf4\u90fd\u662f\u5408\u6cd5\u7684\u4ef7\u503c \u7c7b\u578b\u3002<samp>null<\/samp><\/p>\n\n\n\n<p>\u6bcf\u4e2a\u503c\u5fc5\u987b\u662f\u552f\u4e00\u7684\u3002\u4f8b\u5982 \u60a8\u53ea\u80fd\u5728\u4e00\u4e2a\u5757\u5b50\u53e5\u4e2d\u4f7f\u7528\u6587\u672c\u3002\u4e00\u4e2a\u5757\u6700\u591a\u5339\u914d\u4e00\u6b21\u3002<samp>when<\/samp><var>x<\/var><samp>when<\/samp><samp>when<\/samp><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f55\u65f6 Else \u963b\u6b62<\/h2>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709\u503c\u4e0e\u8868\u8fbe\u5f0f\u5339\u914d\uff0c\u5219\u6267\u884c\u8be5\u5757\u3002<samp>when<\/samp><samp>when&nbsp;else<\/samp><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>Salesforce \u5efa\u8bae\u5305\u542b\u5757\uff0c\u5c24\u5176\u662f\u679a\u4e3e\u7c7b\u578b\uff0c\u5c3d\u7ba1\u8fd9\u4e0d\u662f\u5fc5\u9700\u7684\u3002 \u4f7f\u7528\u679a\u4e3e\u751f\u6210\u8bed\u53e5\u65f6 \u6258\u7ba1\u5305\u63d0\u4f9b\u7684\u503c\uff0c\u5219\u4ee3\u7801\u53ef\u80fd\u65e0\u6cd5\u6309\u9884\u671f\u65b9\u5f0f\u8fd0\u884c\uff0c\u5982\u679c \u65b0\u7248\u672c\u7684\u5305\u5305\u542b\u5176\u4ed6\u679a\u4e3e\u503c\u3002\u60a8\u53ef\u4ee5\u9632\u6b62\u8fd9\u79cd\u60c5\u51b5\u53d1\u751f \u95ee\u9898\uff0c\u5305\u62ec\u4e00\u4e2a\u5757 \u5904\u7406\u610f\u5916\u503c\u3002<samp>when&nbsp;else<\/samp><samp>switch<\/samp><samp>when&nbsp;else<\/samp><\/p>\n\n\n\n<p>\u5982\u679c\u5305\u542b\u5757\uff0c\u5219\u5b83\u5fc5\u987b\u662f \u8bed\u53e5\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5757\u3002<samp>when&nbsp;else<\/samp><samp>switch<\/samp><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6587\u672c\u793a\u4f8b<\/h2>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u503c\u8fdb\u884c\u5207\u6362 \u5728 Integer\u3001Long \u548c String \u7c7b\u578b\u4e0a\u3002\u5b57\u7b26\u4e32\u5b50\u53e5\u533a\u5206\u5927\u5c0f\u5199\u3002\u4f8b\u5982 \u201corange\u201d\u4e0e\u201cORANGE\u201d\u7684\u503c\u4e0d\u540c\u3002<samp>when<\/samp><\/p>\n\n\n\n<p><strong>\u5355\u503c\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>\u4e0b\u9762\u7684\u793a\u4f8b\u5bf9\u503c\u4f7f\u7528\u6574\u6570\u6587\u672c\u3002<samp>when<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on i {\n   when 2 {\n       System.debug('when block 2');\n   }\n   when -3 {\n       System.debug('when block -3');\n   }\n   when else {\n       System.debug('default');\n   }\n}<\/code><\/pre>\n\n\n\n<p><strong>Null \u503c\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>\u7531\u4e8e Apex \u4e2d\u7684\u6240\u6709\u7c7b\u578b\u90fd\u53ef\u4ee5\u4e3a null\uff0c\u56e0\u6b64\u503c\u53ef\u4ee5\u4e3a .<samp>when<\/samp><samp>null<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on i {\n   when 2 {\n       System.debug('when block 2');\n   }\n   when null {\n       System.debug('bad integer');\n   }\n   when else {\n       System.debug('default ' + i);\n   }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u591a\u503c\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>Apex \u8bed\u53e5\u6ca1\u6709 \u56de\u9000\uff0c\u4f46\u5b50\u53e5\u53ef\u4ee5\u5305\u62ec \u8981\u5339\u914d\u7684\u591a\u4e2a\u6587\u672c\u503c\u3002\u60a8\u8fd8\u53ef\u4ee5\u5d4c\u5957 Apex \u8bed\u53e5\u4ee5\u63d0\u4f9b\u591a\u4e2a\u6267\u884c \u5b50\u53e5\u4e2d\u7684\u8def\u5f84\u3002<samp>switch<\/samp><samp>when<\/samp><samp>switch<\/samp><samp>when<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on i {\n   when 2, 3, 4 {\n       System.debug('when block 2 and 3 and 4');\n   }\n   when 5, 6 {\n       System.debug('when block 5 and 6');\n   }\n   when 7 {\n       System.debug('when block 7');\n   }\n   when else {\n       System.debug('default');\n   }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u65b9\u6cd5\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u793a\u4f8b\u4e0d\u662f\u6253\u5f00\u53d8\u91cf\u8868\u8fbe\u5f0f\uff0c\u800c\u662f\u6253\u5f00 \u65b9\u6cd5\u8c03\u7528\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on someInteger(i) {\n   when 2 {\n       System.debug('when block 2');\n   }\n   when 3 {\n       System.debug('when block 3');\n   }\n   when else {\n       System.debug('default');\n   }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">sObjects \u793a\u4f8b<\/h2>\n\n\n\n<p>\u901a\u8fc7\u6253\u5f00 sObject \u503c\uff0c\u53ef\u4ee5\u9690\u5f0f\u6267\u884c\u68c0\u67e5\u548c\u5f3a\u5236\u8f6c\u6362\u3002\u4f8b\u5982 \u8bf7\u8003\u8651\u4ee5\u4e0b\u4f7f\u7528 if-else \u8bed\u53e5\u7684\u4ee3\u7801\u3002<samp>instanceof<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (sobject instanceof Account) {\n    Account a = (Account) sobject;\n    System.debug('account ' + a);\n} else if (sobject instanceof Contact) {\n    Contact c = (Contact) sobject;\n    System.debug('contact ' + c);\n} else {\n    System.debug('default');\n}<\/code><\/pre>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u8bed\u53e5\u66ff\u6362\u548c\u7b80\u5316\u6b64\u4ee3\u7801\u3002<samp>switch<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on sobject {\n   when Account a {\n       System.debug('account ' + a);\n   }\n   when Contact c {\n       System.debug('contact ' + c);\n   }\n   when null {\n       System.debug('null');\n   }\n   when else {\n       System.debug('default');\n   }\n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u6bcf\u4e2a\u5757\u53ea\u80fd\u4f7f\u7528\u4e00\u79cd sObject \u7c7b\u578b\u3002<samp>when<\/samp><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u679a\u4e3e\u793a\u4f8b<\/h2>\n\n\n\n<p>\u4f7f\u7528\u679a\u4e3e\u503c\u7684\u8bed\u53e5\u4e0d\u9700\u8981\u5757\uff0c\u4f46\u5efa\u8bae\u8fd9\u6837\u505a\u3002\u60a8\u53ef\u4ee5 \u6bcf\u4e2a\u5757\u4f7f\u7528\u591a\u4e2a\u679a\u4e3e\u503c \u7b2c\u3002<samp>switch<\/samp><samp>when<\/samp><samp>when&nbsp;else<\/samp><samp>when<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>switch on season {\n   when WINTER {\n       System.debug('boots');\n   }\n   when SPRING, SUMMER {\n       System.debug('sandals');\n   }\n   when else {\n       System.debug('none of the above');\n   }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5faa\u73af<\/h2>\n\n\n\n<p>Apex \u652f\u6301\u4e94\u79cd\u7c7b\u578b\u7684\u8fc7\u7a0b\u5faa\u73af\u3002\u652f\u6301\u4ee5\u4e0b\u7c7b\u578b\u7684\u8fc7\u7a0b\u5faa\u73af\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><samp>do\u00a0{<var>statement<\/var>}\u00a0while\u00a0(<var>Boolean_condition<\/var>);<\/samp><\/li>\n\n\n\n<li><samp>while\u00a0(<var>Boolean_condition<\/var>)\u00a0<var>statement<\/var>;<\/samp><\/li>\n\n\n\n<li><samp>for\u00a0(<var>initialization<\/var>;\u00a0<var>Boolean_exit_condition<\/var>;\u00a0<var>increment<\/var>)\u00a0<var>statement<\/var>;<\/samp><\/li>\n\n\n\n<li><samp>for\u00a0(<var>variable<\/var>\u00a0:\u00a0<var>array_or_set<\/var>)\u00a0<var>statement<\/var>;<\/samp><\/li>\n\n\n\n<li><samp>for\u00a0(<var>variable<\/var>\u00a0: [<var>inline_soql_query<\/var>])\u00a0<var>statement<\/var>;<\/samp><\/li>\n<\/ul>\n\n\n\n<p>\u6240\u6709\u73af\u8def\u90fd\u5141\u8bb8\u73af\u8def\u63a7\u5236\u7ed3\u6784\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><samp>break;<\/samp>\u9000\u51fa\u6574\u4e2a\u5faa\u73af<\/li>\n\n\n\n<li><samp>continue;<\/samp>\u8df3\u5230\u4e0b\u4e00\u4e2a\u8fed\u4ee3 \u7684\u5faa\u73af<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Do-While \u5faa\u73af<\/li>\n\n\n\n<li>While \u5faa\u73af<\/li>\n\n\n\n<li>For \u5faa\u73af<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Do-While \u5faa\u73af<\/h2>\n\n\n\n<p>Apex \u5faa\u73af\u91cd\u590d\u6267\u884c \u4ee3\u7801\u5757\uff0c\u53ea\u8981\u7279\u5b9a\u7684\u5e03\u5c14\u6761\u4ef6\u4fdd\u6301\u4e3a\u771f\u3002\u5176\u8bed\u6cd5 \u662f\uff1a<\/p>\n\n\n\n<p><samp>do-while<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>do {\n   <em>code_block<\/em>\n} while (condition);<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5927\u62ec\u53f7 \uff08\uff09 \u662f \u59cb\u7ec8\u9700\u8981\u56f4\u7ed5 .<samp>{}<\/samp><samp>&nbsp;<var>code_block<\/var><\/samp><\/p>\n\n\n\n<p>\u4e0e Java \u4e00\u6837\uff0cApex \u5faa\u73af\u6ca1\u6709 \u68c0\u67e5\u5e03\u5c14\u6761\u4ef6\u8bed\u53e5\uff0c\u76f4\u5230\u6267\u884c\u7b2c\u4e00\u4e2a\u5faa\u73af\u4e4b\u540e\u3002 \u56e0\u6b64\uff0c\u4ee3\u7801\u5757\u59cb\u7ec8\u81f3\u5c11\u8fd0\u884c\u4e00\u6b21\u3002<samp>do-while<\/samp>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u6570\u5b57 1 &#8211; 10 \u8f93\u51fa\u5230\u8c03\u8bd5\u4e2d \u65e5\u5fd7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Integer count = 1;\n\ndo {\n    System.debug(count);\n    count++;\n} while (count &lt; 11);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">While \u5faa\u73af<\/h2>\n\n\n\n<p>Apex \u5faa\u73af\u91cd\u590d\u6267\u884c\u4e00\u4e2a\u5757 \u53ea\u8981\u7279\u5b9a\u7684\u5e03\u5c14\u6761\u4ef6\u4fdd\u6301\u4e3a\u771f\u3002\u5176\u8bed\u6cd5 \u662f\uff1a<\/p>\n\n\n\n<p><samp>while<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while (condition) {\n    <em>code_block<\/em>\n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4ec5\u5f53\u5757\u5305\u542b\u591a\u4e2a\u5927\u62ec\u53f7 \uff08\uff09 \u65f6\uff0c\u624d\u9700\u8981\u5728 a \u5468\u56f4\u52a0\u4e0a\u5927\u62ec\u53f7 \uff08\uff09 \u9648\u8ff0\u3002<samp>{}<\/samp><samp>&nbsp;<var>code_block<\/var><\/samp><\/p>\n\n\n\n<p>\u4e0e \u4e0d\u540c\u7684\u662f\uff0c\u5faa\u73af\u68c0\u67e5\u5e03\u5c14\u6761\u4ef6\u8bed\u53e5 \u5728\u6267\u884c\u7b2c\u4e00\u4e2a\u5faa\u73af\u4e4b\u524d\u3002\u56e0\u6b64\uff0c\u4ee3\u7801\u5757\u53ef\u4ee5 \u4ece\u4e0d\u6267\u884c\u3002<samp>do-while<\/samp><samp>while<\/samp>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u6570\u5b57 1 &#8211; 10 \u8f93\u51fa\u5230\u8c03\u8bd5\u4e2d \u65e5\u5fd7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Integer count = 1;\n\nwhile (count &lt; 11) {\n    System.debug(count);\n    count++;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">For \u5faa\u73af<\/h2>\n\n\n\n<p>Apex \u652f\u6301\u5faa\u73af\u7684\u4e09\u79cd\u53d8\u4f53\uff1a<\/p>\n\n\n\n<p><samp>for<\/samp><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f20\u7edf\u5faa\u73af\uff1a<samp>for<\/samp><code>for (<em>init_stmt<\/em>; <em>exit_condition<\/em>; <em>increment_stmt<\/em>) { <em>code_block<\/em> }<\/code><\/li>\n\n\n\n<li>\u5217\u8868\u6216\u8bbe\u7f6e\u8fed\u4ee3\u5faa\u73af\uff1a<samp>for<\/samp><code>for (<em>variable<\/em> : <em>list_or_set<\/em>) { <em>code_block<\/em> }<\/code>\u5176\u4e2d\u5fc5\u987b\u662f\u76f8\u540c\u7684\u57fa\u5143\u6216 sObject \u7c7b\u578b\u4e3a \u3002<samp>&nbsp;<var>variable<\/var><\/samp><samp>&nbsp;<var>list_or_set<\/var><\/samp><\/li>\n\n\n\n<li>SOQL \u5faa\u73af\uff1a<samp>for<\/samp><code>for (<em>variable<\/em> : [<em>soql_query<\/em>]) { <em>code_block<\/em> }<\/code>\u6216<code>for (<em>variable_list<\/em> : [<em>soql_query<\/em>]) { <em>code_block<\/em> }<\/code>\u4e24\u8005\u5fc5\u987b\u5c5e\u4e8e\u76f8\u540c\u7684 sObject \u7c7b\u578b \u8fd4\u56de\u7684 .<samp>&nbsp;<var>variable<\/var><\/samp><samp>&nbsp;<var>variable_list<\/var><\/samp><samp>&nbsp;<var>soql_query<\/var><\/samp><\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4ec5\u5f53\u5757\u5305\u542b\u591a\u4e2a\u5927\u62ec\u53f7 \uff08\uff09 \u65f6\uff0c\u624d\u9700\u8981\u5728 a \u5468\u56f4\u52a0\u4e0a\u5927\u62ec\u53f7 \uff08\uff09 \u9648\u8ff0\u3002<samp>{}<\/samp><samp>&nbsp;<var>code_block<\/var><\/samp><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u5404\u8282\u5c06\u8fdb\u4e00\u6b65\u8ba8\u8bba\u6bcf\u79cd\u65b9\u6cd5\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f20\u7edf For \u5faa\u73af<\/strong><\/li>\n\n\n\n<li><strong>\u5217\u51fa\u6216\u8bbe\u7f6e\u5faa\u73af\u7684\u8fed\u4ee3<\/strong><\/li>\n\n\n\n<li><strong>\u8fed\u4ee3\u96c6\u5408<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f20\u7edf For \u5faa\u73af<\/h2>\n\n\n\n<p>Apex \u4e2d\u7684\u4f20\u7edf\u5faa\u73af\u5bf9\u5e94\u4e8e Java \u548c\u5176\u4ed6\u8bed\u8a00\u4e2d\u4f7f\u7528\u7684\u4f20\u7edf\u8bed\u6cd5\u3002\u5176\u8bed\u6cd5 \u662f\uff1a<\/p>\n\n\n\n<p><samp>for<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (<em>init_stmt<\/em>; <em>exit_condition<\/em>; <em>increment_stmt<\/em>) {\n    <em>code_block<\/em>\n}<\/code><\/pre>\n\n\n\n<p>\u6267\u884c\u6b64\u7c7b\u5faa\u73af\u65f6\uff0cApex \u8fd0\u884c\u65f6\u5f15\u64ce\u6309\u987a\u5e8f\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<p><samp>for<\/samp><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6267\u884c\u5faa\u73af\u7684\u7ec4\u4ef6\u3002\u8bf7\u6ce8\u610f\uff0c \u53ef\u4ee5\u5728\u6b64\u8bed\u53e5\u4e2d\u58f0\u660e\u548c\/\u6216\u521d\u59cb\u5316\u591a\u4e2a\u53d8\u91cf\u3002<samp>&nbsp;<var>init_stmt<\/var><\/samp><\/li>\n\n\n\n<li>\u6267\u884c\u68c0\u67e5\u3002\u5982\u679c\u4e3a true\uff0c\u5219\u5faa\u73af \u7ee7\u7eed\u3002\u5982\u679c\u4e3a false\uff0c\u5219\u5faa\u73af\u9000\u51fa\u3002<samp>&nbsp;<var>exit_condition<\/var><\/samp><\/li>\n\n\n\n<li>\u6267\u884c .<samp>&nbsp;<var>code_block<\/var><\/samp><\/li>\n\n\n\n<li>\u6267\u884c\u8bed\u53e5\u3002<samp>&nbsp;<var>increment_stmt<\/var><\/samp><\/li>\n\n\n\n<li>\u8fd4\u56de\u5230\u6b65\u9aa4 2\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u6570\u5b57 1 &#8211; 10 \u8f93\u51fa\u5230\u8c03\u8bd5\u65e5\u5fd7\u4e2d\u3002\u6ce8\u610f \u4e00\u4e2a\u989d\u5916\u7684\u521d\u59cb\u5316\u53d8\u91cf\uff0c \u5305\u542b\u4ee5\u6f14\u793a\u8bed\u6cd5\uff1a<\/p>\n\n\n\n<p><samp>j<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (Integer i = 0, j = 0; i &lt; 10; i++) {\n    System.debug(i+1);\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5217\u51fa\u6216\u8bbe\u7f6e\u5faa\u73af\u7684\u8fed\u4ee3<\/h2>\n\n\n\n<p>\u5217\u8868\u6216\u8bbe\u7f6e\u8fed\u4ee3\u5faa\u73af\u5faa\u73af \u5217\u8868\u6216\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20\u3002\u5176\u8bed\u6cd5 \u662f\uff1a<\/p>\n\n\n\n<p><samp>for<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (<em>variable<\/em> : <em>list_or_set<\/em>) {\n    <em>code_block<\/em>\n}<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u57fa\u5143\u6216 sObject \u7c7b\u578b \u5982\u3002<\/p>\n\n\n\n<p><samp>&nbsp;<var>variable<\/var><\/samp><samp>&nbsp;<var>list_or_set<\/var><\/samp><\/p>\n\n\n\n<p>\u6267\u884c\u6b64\u7c7b\u5faa\u73af\u65f6\uff0cApex \u8fd0\u884c\u65f6\u5f15\u64ce\u5c06 \u5206\u914d\u7ed9 \u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\uff0c\u5e76\u8fd0\u884c for each \u503c\u3002<samp>for<\/samp><samp>&nbsp;<var>variable<\/var><\/samp><samp>&nbsp;<var>list_or_set<\/var><\/samp><samp>&nbsp;<var>code_block<\/var><\/samp>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u6570\u5b57 1 &#8211; 10 \u8f93\u51fa\u5230\u8c03\u8bd5\u65e5\u5fd7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Integer&#91;] myInts = new Integer&#91;]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\n\nfor (Integer i : myInts) {\n    System.debug(i);\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8fed\u4ee3\u96c6\u5408<\/h2>\n\n\n\n<p>\u96c6\u5408\u53ef\u4ee5\u7531\u5217\u8868\u3001\u96c6\u5408\u6216\u5730\u56fe\u7ec4\u6210\u3002\u4fee\u6539\u96c6\u5408\u7684 \u5143\u7d20\uff0c\u800c\u4e0d\u652f\u6301\u5faa\u73af\u8bbf\u95ee\u8be5\u96c6\u5408 \u5e76\u5bfc\u81f4\u9519\u8bef\u3002\u8bf7\u52ff\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u76f4\u63a5\u6dfb\u52a0\u6216\u5220\u9664\u5143\u7d20 \u5faa\u73af\u8bbf\u95ee\u5305\u542b\u5b83\u4eec\u7684\u96c6\u5408\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5728\u8fed\u4ee3\u671f\u95f4\u6dfb\u52a0\u5143\u7d20<\/h2>\n\n\n\n<p>\u8981\u6dfb\u52a0 \u5143\u7d20\uff0c\u5728\u8fed\u4ee3\u5217\u8868\u3001\u96c6\u5408\u6216\u6620\u5c04\u65f6\uff0c\u4fdd\u7559\u65b0\u5143\u7d20 \u5728\u4e34\u65f6\u5217\u8868\u4e2d\uff0c\u8bbe\u7f6e\u6216\u6620\u5c04\u5e76\u5c06\u5b83\u4eec\u6dfb\u52a0\u5230\u539f\u59cb\u5217\u8868\u4e4b\u540e \u5b8c\u6210\u5faa\u73af\u8bbf\u95ee\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5728\u8fed\u4ee3\u671f\u95f4\u5220\u9664\u5143\u7d20<\/h2>\n\n\n\n<p>\u5220\u9664 \u5143\u7d20\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u5217\u8868\uff0c\u7136\u540e\u590d\u5236 \u60a8\u5e0c\u671b\u4fdd\u7559\u7684\u5143\u7d20\u3002\u6216\u8005\uff0c\u6dfb\u52a0\u60a8\u60f3\u8981\u7684\u5143\u7d20 \u5220\u9664\u5230\u4e34\u65f6\u5217\u8868\u5e76\u5728\u5b8c\u6210\u8fed\u4ee3\u540e\u5c06\u5176\u5220\u9664 \u96c6\u5408\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u8be5\u65b9\u6cd5\u4ee5\u7ebf\u6027\u65b9\u5f0f\u6267\u884c\u3002\u7528\u5b83\u6765\u5220\u9664\u5143\u7d20\u6709\u65f6\u95f4\u548c \u8d44\u6e90\u5f71\u54cd\u3002<samp>List.remove<\/samp><\/p>\n\n\n\n<p>\u5728\u8fed\u4ee3\u65f6\u5220\u9664\u5143\u7d20 \u5730\u56fe\u6216\u96c6\u5408\uff0c\u5c06\u8981\u5220\u9664\u7684\u952e\u4fdd\u5b58\u5728\u4e34\u65f6\u5217\u8868\u4e2d\uff0c \u7136\u540e\u5728\u5b8c\u6210\u5faa\u73af\u8bbf\u95ee\u96c6\u5408\u540e\u5220\u9664\u5b83\u4eec\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/langCon_apex_control_flow.htm\">\u53c2\u8003<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apex \u63d0\u4f9b\u4e86 if-else \u8bed\u53e5\u3001switch \u8bed\u53e5\u548c\u5faa\u73af\u6765\u63a7\u5236 \u4ee3\u7801\u6267\u884c\u3002\u8bed\u53e5\u901a\u5e38\u6309\u7167\u5b83\u4eec\u51fa\u73b0\u7684\u987a\u5e8f\u9010 &hellip; <a href=\"http:\/\/www.ponybai.com\/?p=3623\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Apex\u63a7\u5236\u6d41\u8bed\u53e5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3624,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[199],"tags":[],"class_list":["post-3623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apex-"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ponybai.com\/?p=3623\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"og:description\" content=\"Apex \u63d0\u4f9b\u4e86 if-else \u8bed\u53e5\u3001switch \u8bed\u53e5\u548c\u5faa\u73af\u6765\u63a7\u5236 \u4ee3\u7801\u6267\u884c\u3002\u8bed\u53e5\u901a\u5e38\u6309\u7167\u5b83\u4eec\u51fa\u73b0\u7684\u987a\u5e8f\u9010 &hellip; \u7ee7\u7eed\u9605\u8bfbApex\u63a7\u5236\u6d41\u8bed\u53e5\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ponybai.com\/?p=3623\" \/>\n<meta property=\"og:site_name\" content=\"\u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-21T00:20:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-21T00:20:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/11\/\u63a7\u5236\u8bed\u53e5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"966\" \/>\n\t<meta property=\"og:image:height\" content=\"421\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ponybai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"ponybai\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3623#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3623\"},\"author\":{\"name\":\"ponybai\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"headline\":\"Apex\u63a7\u5236\u6d41\u8bed\u53e5\",\"datePublished\":\"2023-11-21T00:20:17+00:00\",\"dateModified\":\"2023-11-21T00:20:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3623\"},\"wordCount\":229,\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"articleSection\":[\"Apex \u5f00\u53d1\u4eba\u5458\u6307\u5357\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3623\",\"url\":\"http:\/\/www.ponybai.com\/?p=3623\",\"name\":\"Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/#website\"},\"datePublished\":\"2023-11-21T00:20:17+00:00\",\"dateModified\":\"2023-11-21T00:20:19+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3623#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ponybai.com\/?p=3623\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3623#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.ponybai.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apex\u63a7\u5236\u6d41\u8bed\u53e5\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ponybai.com\/#website\",\"url\":\"http:\/\/www.ponybai.com\/\",\"name\":\"\u767d\u767d\u968f\u7b14\",\"description\":\"Salesforce\u5b98\u65b9\u8bb2\u5e08\",\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ponybai.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\",\"name\":\"ponybai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"contentUrl\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"width\":248,\"height\":248,\"caption\":\"ponybai\"},\"logo\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/121.37.188.161\"],\"url\":\"http:\/\/www.ponybai.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14","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":"http:\/\/www.ponybai.com\/?p=3623","og_locale":"zh_CN","og_type":"article","og_title":"Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14","og_description":"Apex \u63d0\u4f9b\u4e86 if-else \u8bed\u53e5\u3001switch \u8bed\u53e5\u548c\u5faa\u73af\u6765\u63a7\u5236 \u4ee3\u7801\u6267\u884c\u3002\u8bed\u53e5\u901a\u5e38\u6309\u7167\u5b83\u4eec\u51fa\u73b0\u7684\u987a\u5e8f\u9010 &hellip; \u7ee7\u7eed\u9605\u8bfbApex\u63a7\u5236\u6d41\u8bed\u53e5","og_url":"http:\/\/www.ponybai.com\/?p=3623","og_site_name":"\u767d\u767d\u968f\u7b14","article_published_time":"2023-11-21T00:20:17+00:00","article_modified_time":"2023-11-21T00:20:19+00:00","og_image":[{"width":966,"height":421,"url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/11\/\u63a7\u5236\u8bed\u53e5.png","type":"image\/png"}],"author":"ponybai","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"ponybai","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ponybai.com\/?p=3623#article","isPartOf":{"@id":"http:\/\/www.ponybai.com\/?p=3623"},"author":{"name":"ponybai","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"headline":"Apex\u63a7\u5236\u6d41\u8bed\u53e5","datePublished":"2023-11-21T00:20:17+00:00","dateModified":"2023-11-21T00:20:19+00:00","mainEntityOfPage":{"@id":"http:\/\/www.ponybai.com\/?p=3623"},"wordCount":229,"publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"articleSection":["Apex \u5f00\u53d1\u4eba\u5458\u6307\u5357"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/www.ponybai.com\/?p=3623","url":"http:\/\/www.ponybai.com\/?p=3623","name":"Apex\u63a7\u5236\u6d41\u8bed\u53e5 - \u767d\u767d\u968f\u7b14","isPartOf":{"@id":"http:\/\/www.ponybai.com\/#website"},"datePublished":"2023-11-21T00:20:17+00:00","dateModified":"2023-11-21T00:20:19+00:00","breadcrumb":{"@id":"http:\/\/www.ponybai.com\/?p=3623#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ponybai.com\/?p=3623"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ponybai.com\/?p=3623#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.ponybai.com\/"},{"@type":"ListItem","position":2,"name":"Apex\u63a7\u5236\u6d41\u8bed\u53e5"}]},{"@type":"WebSite","@id":"http:\/\/www.ponybai.com\/#website","url":"http:\/\/www.ponybai.com\/","name":"\u767d\u767d\u968f\u7b14","description":"Salesforce\u5b98\u65b9\u8bb2\u5e08","publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ponybai.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883","name":"ponybai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/","url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","contentUrl":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","width":248,"height":248,"caption":"ponybai"},"logo":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/121.37.188.161"],"url":"http:\/\/www.ponybai.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3623"}],"version-history":[{"count":1,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3623\/revisions"}],"predecessor-version":[{"id":3625,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3623\/revisions\/3625"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/media\/3624"}],"wp:attachment":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3623"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}