{"id":203737,"date":"2025-05-22T10:48:12","date_gmt":"2025-05-22T02:48:12","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203737\/"},"modified":"2025-05-22T10:48:12","modified_gmt":"2025-05-22T02:48:12","slug":"spring-data-jpa-%e6%b5%81%e6%9f%a5%e8%af%a2%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203737\/","title":{"rendered":"Spring Data JPA \u6d41\u67e5\u8be2\u65b9\u6cd5"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Spring Data JPA \u6d41\u67e5\u8be2\u65b9\u6cd5<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u54c8\u55bd\uff01\u4eca\u5929\u5fc3\u8840\u6765\u6f6e\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aSpring Data JPA \u6d41\u67e5\u8be2\u65b9\u6cd5\u300b<\/span>\uff0c\u60f3\u5fc5\u5927\u5bb6\u5e94\u8be5\u5bf9<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u90fd\u4e0d\u964c\u751f\u5427\uff0c\u90a3\u4e48\u9605\u8bfb\u672c\u6587\u5c31\u90fd\u4e0d\u4f1a\u5f88\u56f0\u96be\uff0c\u4ee5\u4e0b\u5185\u5bb9\u4e3b\u8981\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u4f60\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\uff0c\u5343\u4e07\u522b\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732103498673dcd4a7220b.jpg\" class=\"aligncenter\"><\/p>\n<h2> \u4ecb\u7ecd <\/h2>\n<p>\u4f20\u7edf\u4e0a\uff0c\u83b7\u53d6\u5927\u91cf\u6570\u636e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5185\u5b58\u8d44\u6e90\u7d27\u5f20\uff0c\u56e0\u4e3a\u5b83\u901a\u5e38\u6d89\u53ca\u5c06\u6574\u4e2a\u7ed3\u679c\u96c6\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002<\/p>\n<p>=&gt; \u6d41\u67e5\u8be2\u65b9\u6cd5\u901a\u8fc7\u63d0\u4f9b\u4e00\u79cd\u4f7f\u7528 java 8 streams<strong> \u589e\u91cf\u5904\u7406\u6570\u636e\u7684\u65b9\u6cd5\u6765\u63d0\u4f9b\u89e3\u51b3\u65b9\u6848\u3002\u8fd9\u53ef\u786e\u4fdd\u4efb\u4f55\u65f6\u5019\u53ea\u6709\u4e00\u90e8\u5206\u6570\u636e\u4fdd\u5b58\u5728\u5185\u5b58\u4e2d\uff0c<\/strong>\u589e\u5f3a\u6027\u80fd\u548c\u53ef\u6269\u5c55\u6027<strong>\u3002<\/strong> <\/p>\n<p>\u5728\u8fd9\u7bc7\u535a\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u6df1\u5165\u7814\u7a76\u6d41\u67e5\u8be2\u65b9\u6cd5\u5728 spring data jpa \u4e2d\u7684\u5de5\u4f5c\u539f\u7406\uff0c\u63a2\u7d22\u5b83\u4eec\u7684\u7528\u4f8b\uff0c\u5e76\u6f14\u793a\u5b83\u4eec\u7684\u5b9e\u73b0\u3002 <\/p>\n<p>\u5bf9\u4e8e\u672c\u6307\u5357\uff0c\u6211\u4eec\u4f7f\u7528\uff1a <\/p>\n<ul>\n  ide\uff1aintellij idea\uff08\u63a8\u8350\u7528\u4e8e spring \u5e94\u7528\u7a0b\u5e8f\uff09\u6216 eclipse <\/p>\n<li> <\/li>\n<p>java \u7248\u672c\uff1a17 <\/p>\n<li> <\/li>\n<p>spring data jpa \u7248\u672c\uff1a2.7.x \u6216\u66f4\u9ad8\u7248\u672c\uff08\u4e0e spring boot 3.x \u517c\u5bb9\uff09 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>&lt;dependency&gt;\n    &lt;groupid&gt;org.springframework.boot&lt;\/groupid&gt;\n    &lt;artifactid&gt;spring-boot-starter-data-jpa&lt;\/artifactid&gt;\n&lt;\/dependency&gt;\n<\/pre>\n<p> \u6ce8\u610f\uff1a\u6709\u5173\u66f4\u8be6\u7ec6\u7684\u793a\u4f8b\uff0c\u8bf7\u8bbf\u95ee\u6211\u7684 github \u5b58\u50a8\u5e93 <\/p>\n<p> 1.\u4ec0\u4e48\u662f\u6d41\u67e5\u8be2\u65b9\u5f0f\uff1f <\/p>\n<h2> <\/h2>\n<p>spring data jpa \u4e2d\u7684\u6d41\u67e5\u8be2\u65b9\u6cd5\u5141\u8bb8\u6211\u4eec\u4ee5 stream \u7684\u5f62\u5f0f\u8fd4\u56de\u67e5\u8be2\u7ed3\u679c\uff0c\u800c\u4e0d\u662f list \u6216\u5176\u4ed6\u96c6\u5408\u7c7b\u578b\u3002\u8fd9\u79cd\u65b9\u6cd5\u6709\u51e0\u4e2a\u597d\u5904\uff1a <\/p>\n<ul>\n<li>\n<p>\u9ad8\u6548\u7684\u8d44\u6e90\u7ba1\u7406<strong>\uff1a\u589e\u91cf\u5904\u7406\u6570\u636e\uff0c\u51cf\u5c11\u5185\u5b58\u5f00\u9500\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p>\u5ef6\u8fdf\u5904\u7406<strong>\uff1a\u6309\u9700\u83b7\u53d6\u548c\u5904\u7406\u7ed3\u679c\uff0c\u975e\u5e38\u9002\u5408\u5206\u9875\u6216\u6279\u5904\u7406\u7b49\u573a\u666f\u3002<\/strong><\/p>\n<\/li>\n<li>\n<p>\u4e0e\u51fd\u6570\u5f0f\u7f16\u7a0b\u96c6\u6210<strong>\uff1a\u6d41\u7b26\u5408 java \u7684\u51fd\u6570\u5f0f\u7f16\u7a0b\u7279\u6027\uff0c\u652f\u6301\u8fc7\u6ee4\u3001\u6620\u5c04\u548c\u6536\u96c6\u7b49\u64cd\u4f5c\u3002<\/strong><\/p>\n<\/li>\n<\/ul>\n<p> 2.\u5982\u4f55\u4f7f\u7528\u6d41\u67e5\u8be2\u65b9\u6cd5\uff1f <\/p>\n<h2> <\/h2>\n<p>=&gt; \u5047\u8bbe\u6211\u4eec\u6b63\u5728\u5f00\u53d1\u4e00\u4e2a\u7535\u5b50\u5546\u52a1\u5e94\u7528\u7a0b\u5e8f\u5e76\u5e0c\u671b\uff1a <\/p>\n<ul>\n  \u68c0\u7d22\u5728\u7279\u5b9a\u65e5\u671f\u4e4b\u540e\u4e0b\u8ba2\u5355\u7684\u6240\u6709\u5ba2\u6237\u3002 <\/p>\n<li> <\/li>\n<p>\u8fc7\u6ee4\u603b\u91d1\u989d\u9ad8\u4e8e\u7279\u5b9a\u63d0\u4f9b\u91d1\u989d\u7684\u8ba2\u5355\u3002 <\/p>\n<li> <\/li>\n<p>\u6309\u8fc7\u53bb 6 \u4e2a\u6708\u5185\u7684\u8ba2\u5355\u603b\u4ef7\u503c\u5bf9\u5ba2\u6237\u8fdb\u884c\u5206\u7ec4\u3002 <\/p>\n<li> <\/li>\n<p>\u8fd4\u56de\u6570\u636e\u4f5c\u4e3a\u5ba2\u6237\u540d\u79f0\u53ca\u5176\u603b\u8ba2\u5355\u4ef7\u503c\u7684\u6458\u8981\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<p>\u5b9e\u4f53<strong><\/strong> <\/p>\n<ul>\n  \u5ba2\u6237\uff1a\u4ee3\u8868\u5ba2\u6237\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>@setter\n@getter\n@entity\n@entity(name = \"tbl_customer\")\npublic class customer {\n    @id\n    @generatedvalue(strategy = generationtype.identity)\n    private long id;\n\n    private string name;\n    private string email;\n\n    @onetomany(mappedby = \"customer\", cascade = cascadetype.all, fetch = fetchtype.lazy)\n    private list&lt;order&gt; orders;\n}\n<\/pre>\n<ul>\n  \u8ba2\u5355\uff1a\u4ee3\u8868\u5ba2\u6237\u4e0b\u7684\u8ba2\u5355\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>@setter\n@getter\n@entity(name = \"tbl_order\")\npublic class order {\n    @id\n    @generatedvalue(strategy = generationtype.identity)\n    private long id;\n\n    private double amount;\n    private localdatetime orderdate;\n\n    @manytoone\n    @joincolumn(name = \"customer_id\")\n    private customer customer;\n}\n<\/pre>\n<p>\u5b58\u50a8\u5e93<strong><\/strong> <\/p>\n<ul>\n  customerrepository \u7528\u4e8e\u9009\u62e9\u5ba2\u6237\u53ca\u5176\u5728\u7279\u5b9a\u65e5\u671f\u4e4b\u540e\u4e0b\u7684\u76f8\u5173\u8ba2\u5355\u3002\u6211\u4eec\u4f7f\u7528 stream&lt;customer&gt; \u800c\u4e0d\u662f list&lt;customer&gt; \u6765\u5904\u7406\u67e5\u8be2\u7ed3\u679c\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>public interface customerrepository extends jparepository&lt;customer, long&gt; {\n    @query(\"\"\"\n                select c from tbl_customer c join fetch c.orders o where o.orderdate &gt;= :startdate\n            \"\"\")\n    @queryhints(\n            @queryhint(name = availablehints.hint_fetch_size, value = \"25\")\n    )\n    stream&lt;customer&gt; findcustomerwithorders(@param(\"startdate\") localdatetime startdate);\n}\n<\/pre>\n<p> \u6ce8\u610f\uff1a <\/p>\n<ul>\n<li>join fetch \u786e\u4fdd\u8ba2\u5355\u88ab\u6025\u5207\u52a0\u8f7d\u3002\n<\/p>\n<\/li>\n<li>@queryhints \u7528\u4e8e\u5411 jpa\uff08\u4f8b\u5982 hibernate\uff09\u63d0\u4f9b\u989d\u5916\u63d0\u793a\u4ee5\u4f18\u5316\u67e5\u8be2\u6267\u884c\u3002\n<\/p>\n<\/li>\n<\/ul>\n<p>=&gt; \u4f8b\u5982\uff0c\u5f53\u6211\u7684\u67e5\u8be2\u8fd4\u56de 100 \u6761\u8bb0\u5f55\u65f6\uff1a <\/p>\n<ul>\n  \u524d 25 \u6761\u8bb0\u5f55\u7531\u5e94\u7528\u7a0b\u5e8f\u83b7\u53d6\u5e76\u5904\u7406\u3002 <\/p>\n<li> <\/li>\n<p>\u5904\u7406\u5b8c\u8fd9\u4e9b\u540e\uff0c\u5c06\u83b7\u53d6\u63a5\u4e0b\u6765\u7684 25 \u6761\u8bb0\u5f55\uff0c\u4f9d\u6b64\u7c7b\u63a8\uff0c\u76f4\u5230\u5904\u7406\u5b8c\u6240\u6709 100 \u6761\u8bb0\u5f55\u3002 <\/p>\n<li> <\/li>\n<p>\u6b64\u884c\u4e3a\u6700\u5927\u9650\u5ea6\u5730\u51cf\u5c11\u4e86\u5185\u5b58\u4f7f\u7528\u91cf\uff0c\u5e76\u907f\u514d\u4e00\u6b21\u5c06\u6240\u6709 100 \u6761\u8bb0\u5f55\u52a0\u8f7d\u5230\u5185\u5b58\u4e2d\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<p>\u670d\u52a1<strong><\/strong> <\/p>\n<pre>@service\n@requiredargsconstructor\npublic class customerorderservice {\n    private final customerrepository customerrepository;\n\n    @transactional(readonly = true)\n    public map&lt;string, double&gt; getcustomerordersummary(localdatetime startdate, double minorderamount) {\n        try (stream&lt;customer&gt; customerstream = customerrepository.findcustomerwithorders(startdate)) {\n            return customerstream\n                    \/\/ filter customers with orders above the threshold\n                    .flatmap(customer -&gt; customer.getorders().stream()\n                            .filter(order -&gt; order.getamount() &gt;= minorderamount)\n                            .map(order -&gt; new abstractmap.simpleentry&lt;&gt;(customer.getname(), order.getamount())))\n                    \/\/ group by customer name and sum order amounts\n                    .collect(collectors.groupingby(\n                            abstractmap.simpleentry::getkey,\n                            collectors.summingdouble(abstractmap.simpleentry::getvalue)\n                    ));\n        }\n    }\n}\n<\/pre>\n<p> \u8fd9\u91cc\u662f\u5904\u7406\u6570\u636e\u7684\u670d\u52a1\u7c7b\uff0c\u6709\u4e24\u4e2a\u53c2\u6570startdate\u548cminorderamount\u3002\u6b63\u5982\u60a8\u6240\u770b\u5230\u7684\uff0c\u6211\u4eec\u4e0d\u4f7f\u7528 sql \u67e5\u8be2\u8fdb\u884c\u8fc7\u6ee4\uff0c\u800c\u662f\u5c06\u6240\u6709\u6570\u636e\u4f5c\u4e3a\u6d41\u52a0\u8f7d\uff0c\u7136\u540e\u901a\u8fc7 java \u4ee3\u7801\u8fdb\u884c\u8fc7\u6ee4\u548c\u5206\u7ec4\u3002 <\/p>\n<p>\u63a7\u5236\u5668<strong><\/strong> <\/p>\n<pre>@restcontroller\n@requestmapping(\"\/customers\")\n@requiredargsconstructor\npublic class customerordercontroller {\n    private final customerorderservice customerorderservice;\n\n    @getmapping(\"\/orders\")\n    public responseentity&lt;map&lt;string, double&gt;&gt; getcustomerordersummary(\n            @requestparam @datetimeformat(iso = datetimeformat.iso.date_time) localdatetime startdate,\n            @requestparam double minorderamount\n    ) {\n        map&lt;string, double&gt; ordersummary = customerorderservice.getcustomerordersummary(startdate, minorderamount);\n        return responseentity.ok(ordersummary);\n    }\n}\n<\/pre>\n<p>\u6d4b\u8bd5<strong><\/strong> <\/p>\n<p>=&gt; \u8981\u521b\u5efa\u6d4b\u8bd5\u6570\u636e\uff0c\u60a8\u53ef\u4ee5\u5728\u6211\u7684\u6e90\u4ee3\u7801\u4e2d\u6267\u884c\u4ee5\u4e0b\u811a\u672c\u6216\u81ea\u5df1\u6dfb\u52a0\u3002 <\/p>\n<p>src\/main\/resources\/dummy-data.sql<strong><\/strong> <\/p>\n<p>\u8bf7\u6c42\uff1a <\/p>\n<ul>\n  \u5f00\u59cb\u65e5\u671f: 2024-05-01t00:00:00 <\/p>\n<li> <\/li>\n<p> \u6700\u5c0f\u8ba2\u5355\u91d1\u989d\uff1a100 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>curl --location 'http:\/\/localhost:8090\/customers\/orders?startdate=2024-05-01t00%3a00%3a00&amp;minorderamount=100'\n<\/pre>\n<p> \u56de\u5e94\uff1a <\/p>\n<ul>\n  \u8fd4\u56de\u603b\u91d1\u989d\u7b49\u4e8e\u6216\u5927\u4e8e minorderamount \u7684\u6240\u6709\u5ba2\u6237\u3002 <\/p>\n<li> <\/li>\n<\/ul>\n<pre>{\n  \"Jane Roe\": 500.0,\n  \"John Doe\": 150.0,\n  \"Bob Brown\": 350.0,\n  \"Alice Smith\": 520.0\n}\n<\/pre>\n<p> 3. \u6d41\u4e0e\u5217\u8868 <\/p>\n<h2> <\/h2>\n<p>=&gt; \u60a8\u53ef\u4ee5\u4f7f\u7528 intellij profiler \u76d1\u63a7\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u548c\u6267\u884c\u65f6\u95f4\u3002\u6709\u5173\u5982\u4f55\u6dfb\u52a0\u548c\u6d4b\u8bd5\u5927\u6570\u636e\u96c6\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff0c\u60a8\u53ef\u4ee5\u5728\u6211\u7684 github \u5b58\u50a8\u5e93\u4e2d\u627e\u5230 <\/p>\n<p>\u5c0f\u6570\u636e\u96c6\uff1a\uff0810 \u4e2a\u5ba2\u6237\uff0c100 \u4e2a\u8ba2\u5355\uff09<strong><\/strong> <\/p>\n<ul>\n  \u6d41\uff1a\u6267\u884c\u65f6\u95f4\uff08~5ms\uff09\uff0c\u5185\u5b58\u4f7f\u7528\uff08\u4f4e\uff09 <\/p>\n<li> <\/li>\n<p>\u5217\u8868\uff1a\u6267\u884c\u65f6\u95f4\uff08~4ms\uff09\uff0c\u5185\u5b58\u4f7f\u7528\uff08\u4f4e\uff09 <\/p>\n<li> <\/li>\n<\/ul>\n<p>\u5927\u578b\u6570\u636e\u96c6\uff0810.000 \u4e2a\u5ba2\u6237\uff0c100.000 \u4e2a\u8ba2\u5355\uff09<strong><\/strong> <\/p>\n<ul>\n  \u6d41\uff1a\u6267\u884c\u65f6\u95f4\uff08~202ms\uff09\uff0c\u5185\u5b58\u4f7f\u7528\uff08\u4e2d\u7b49\uff09 <\/p>\n<li> <\/li>\n<p>\u5217\u8868\uff1a\u6267\u884c\u65f6\u95f4\uff08~176ms\uff09\uff0c\u5185\u5b58\u4f7f\u7528\uff08\u9ad8\uff09 <\/p>\n<li> <\/li>\n<\/ul>\n<p>\u6027\u80fd\u6307\u6807<strong><\/strong> <\/p>\n<table>\n<tbody>\n<tr>\n<th>metric<\/th>\n<th>stream<\/th>\n<th>list<\/th>\n<\/tr>\n<tr>\n<td><b>initial fetch time<\/b><\/td>\n<td>slightly slower (due to lazy loading)<\/td>\n<td>faster (all at once)<\/td>\n<\/tr>\n<tr>\n<td><b>memory consumption<\/b><\/td>\n<td>low (incremental processing)<\/td>\n<td>high (entire dataset in memory)<\/td>\n<\/tr>\n<tr>\n<td><b>memory consumption<\/b><\/td>\n<td>low (incremental processing)<\/td>\n<td>high (entire dataset in memory)<\/td>\n<\/tr>\n<tr>\n<td><b>processing overhead<\/b><\/td>\n<td>efficient for large datasets<\/td>\n<td>may cause memory issues for large datasets<\/td>\n<\/tr>\n<tr>\n<td><b>batch fetching<\/b><\/td>\n<td>supported (with fetch size)<\/td>\n<td>not applicable<\/td>\n<\/tr>\n<tr>\n<td><b>error recovery<\/b><\/td>\n<td>graceful with early termination<\/td>\n<td>limited, as data is preloaded<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>  \u603b\u7ed3 <\/p>\n<h2> <\/h2>\n<p>spring data jpa \u6d41\u67e5\u8be2\u65b9\u6cd5\u63d0\u4f9b\u4e86\u4e00\u79cd\u4f18\u96c5\u7684\u65b9\u5f0f\u6765\u9ad8\u6548\u5904\u7406\u5927\u578b\u6570\u636e\u96c6\uff0c\u540c\u65f6\u5229\u7528 java streams \u7684\u5f3a\u5927\u529f\u80fd\u3002\u901a\u8fc7\u589e\u91cf\u5904\u7406\u6570\u636e\uff0c\u5b83\u4eec\u51cf\u5c11\u4e86\u5185\u5b58\u6d88\u8017\u5e76\u4e0e\u73b0\u4ee3\u51fd\u6570\u5f0f\u7f16\u7a0b\u8303\u4f8b\u65e0\u7f1d\u96c6\u6210\u3002 <\/p>\n<p>\u60a8\u5bf9\u6d41\u67e5\u8be2\u65b9\u6cd5\u6709\u4f55\u770b\u6cd5\uff1f\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u4e2d\u5206\u4eab\u60a8\u7684\u7ecf\u9a8c\u548c\u7528\u4f8b\uff01 <\/p>\n<p>\u4e0b\u4e00\u7bc7\u6587\u7ae0\u89c1\u3002\u5feb\u4e50\u7f16\u7801\uff01 <\/p>\n<p>\u4eca\u5929\u5173\u4e8e\u300aSpring Data JPA \u6d41\u67e5\u8be2\u65b9\u6cd5\u300b\u7684\u5185\u5bb9\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\uff0c\u5982\u679c\u6709\u4ec0\u4e48\u7591\u95ee\u6216\u8005\u5efa\u8bae\uff0c\u53ef\u4ee5\u5728\u516c\u4f17\u53f7\u4e0b\u591a\u591a\u56de\u590d\u4ea4\u6d41\uff1b\u6587\u4e2d\u82e5\u6709\u4e0d\u6b63\u4e4b\u5904\uff0c\u4e5f\u5e0c\u671b\u56de\u590d\u7559\u8a00\u4ee5\u544a\u77e5\uff01<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Data JPA &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203737","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203737"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203737\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}