{"id":171045,"date":"2024-05-08T17:20:39","date_gmt":"2024-05-08T09:20:39","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/171045.html"},"modified":"2024-05-08T17:20:44","modified_gmt":"2024-05-08T09:20:44","slug":"javascript-class%e5%a6%82%e4%bd%95%e4%bb%8ejson%e4%bc%98%e9%9b%85%e7%9a%84%e6%81%a2%e5%a4%8dclass%e7%9a%84%e5%ae%9e%e4%be%8b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/171045.html","title":{"rendered":"Javascript class\u5982\u4f55\u4ecejson\u4f18\u96c5\u7684\u6062\u590dclass\u7684\u5b9e\u4f8b"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27041956\/e9ef9cfa-1629-4823-bff4-af064e31a631.webp\" alt=\"Javascript class\u5982\u4f55\u4ecejson\u4f18\u96c5\u7684\u6062\u590dclass\u7684\u5b9e\u4f8b\" \/><\/p>\n<p><p>\u5728JavaScript\u4e2d\uff0c\u4eceJSON\u4f18\u96c5\u5730\u6062\u590d\u7c7b\u7684\u5b9e\u4f8b\u4e3b\u8981\u6d89\u53ca\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a<strong>\u89e3\u6790JSON\u5b57\u7b26\u4e32\u3001\u6784\u9020\u7c7b\u5b9e\u4f8b<\/strong>\u3001\u4ee5\u53ca<strong>\u786e\u4fdd\u7c7b\u65b9\u6cd5\u7684\u6b63\u786e\u7ed1\u5b9a<\/strong>\u3002\u8fd9\u6d89\u53ca\u5230\u6df1\u5165\u7406\u89e3JSON\u7684\u89e3\u6790\u3001\u7c7b\u7684\u5b9e\u73b0\u4ee5\u53ca\u539f\u578b\u94fe\u7684\u64cd\u4f5c\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u901a\u5e38\u9996\u9009\u7684\u65b9\u6cd5\u662f\u5b9a\u4e49\u4e00\u4e2a\u80fd\u591f\u63a5\u6536\u4e00\u4e2a\u5bf9\u8c61\uff08\u901a\u5e38\u662f\u89e3\u6790JSON\u6240\u5f97\u7684\u5bf9\u8c61\uff09\u4f5c\u4e3a\u53c2\u6570\u7684\u6784\u9020\u51fd\u6570\u6216\u5de5\u5382\u65b9\u6cd5\uff0c\u5e76\u5728\u5176\u4e2d\u624b\u52a8\u8bbe\u7f6e\u5b9e\u4f8b\u5c5e\u6027\u548c\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u4e2a\u5e38\u89c1\u7684\u573a\u666f\u662f\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u4ece\u670d\u52a1\u5668\u63a5\u6536\u5230\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\uff0c\u4ee3\u8868\u67d0\u4e2a\u7c7b\u7684\u5b9e\u4f8b\u7684\u72b6\u6001\u3002\u6211\u4eec\u5e0c\u671b\u80fd\u591f\u5c06\u8fd9\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u56de\u5177\u6709\u76f8\u5e94\u65b9\u6cd5\u548c\u5c5e\u6027\u7684\u7c7b\u7684\u5b9e\u4f8b\uff0c\u800c\u4e0d\u662f\u7b80\u5355\u7684JS\u5bf9\u8c61\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c<strong>\u6700\u76f4\u89c2\u7684\u65b9\u5f0f\u662f\u5728\u7c7b\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u9759\u6001\u65b9\u6cd5<\/strong>\uff0c\u8be5\u65b9\u6cd5\u63a5\u53d7\u4e00\u4e2a\u666e\u901a\u5bf9\u8c61\uff08\u6bd4\u5982\u7531JSON.parse()\u89e3\u6790\u5f97\u5230\u7684\u5bf9\u8c61\uff09\uff0c\u5e76\u5229\u7528\u8fd9\u4e2a\u5bf9\u8c61\u7684\u5c5e\u6027\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001JSON \u89e3\u6790\u4e0e\u7c7b\u7684\u6784\u9020<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406JSON\u5b57\u7b26\u4e32\u7684\u89e3\u6790\u3002\u6807\u51c6\u7684<code>JSON.parse()<\/code>\u65b9\u6cd5\u80fd\u5c06JSON\u5b57\u7b26\u4e32\u89e3\u6790\u6210JavaScript\u7684\u57fa\u672c\u5bf9\u8c61\uff0c\u4f46\u8fd9\u901a\u5e38\u4e0d\u4f1a\u81ea\u52a8\u5730\u5c06\u8fd9\u4e2a\u5bf9\u8c61\u8f6c\u6362\u6210\u6240\u9700\u7c7b\u7684\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">class Person {<\/p>\n<p>  constructor(name, age) {<\/p>\n<p>    this.name = name;<\/p>\n<p>    this.age = age;<\/p>\n<p>  }<\/p>\n<p>  greet() {<\/p>\n<p>    console.log(`Hello, my name is ${this.name}, and I am ${this.age} years old.`);<\/p>\n<p>  }<\/p>\n<p>  static fromJSON(jsonString) {<\/p>\n<p>    const data = JSON.parse(jsonString);<\/p>\n<p>    return new Person(data.name, data.age);<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u4f8b\u5b50\u5c55\u793a\u4e86\u5982\u4f55\u4e3a<code>Person<\/code>\u7c7b\u5b9a\u4e49\u4e00\u4e2a<code>fromJSON<\/code>\u9759\u6001\u65b9\u6cd5\u3002\u8fd9\u4e2a\u65b9\u6cd5\u63a5\u53d7\u4e00\u4e2aJSON\u5b57\u7b26\u4e32\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684<code>Person<\/code>\u5b9e\u4f8b\u3002\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u4e86\u7c7b\u6784\u9020\u51fd\u6570\u6765\u786e\u4fdd\u6b63\u786e\u5730\u6062\u590d\u7c7b\u5b9e\u4f8b\u53ca\u5176\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u786e\u4fdd\u65b9\u6cd5\u7684\u6b63\u786e\u7ed1\u5b9a<\/h3>\n<\/p>\n<p><p>\u4ec5\u4ec5\u80fd\u591f\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u6b63\u786e\u5c5e\u6027\u7684\u5b9e\u4f8b\u662f\u4e0d\u591f\u7684\u3002\u4e3a\u4e86\u5b8c\u5168\u6062\u590d\u7c7b\u7684\u5b9e\u4f8b\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u786e\u4fdd\u8be5\u5b9e\u4f8b\u7684\u65b9\u6cd5\u80fd\u591f\u6b63\u786e\u5730\u5de5\u4f5c\u3002\u8fd9\u901a\u5e38\u6d89\u53ca\u5230\u5bf9\u539f\u578b\u94fe\u7684\u64cd\u4f5c\uff0c\u786e\u4fdd\u65b9\u6cd5\u80fd\u591f\u6b63\u786e\u7ed1\u5b9a\u5230\u5b9e\u4f8b\u4e0a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">class Person {<\/p>\n<p>  constructor(name, age) {<\/p>\n<p>    this.name = name;<\/p>\n<p>    this.age = age;<\/p>\n<p>  }<\/p>\n<p>  greet() {<\/p>\n<p>    console.log(`Hello, my name is ${this.name}, and I am ${this.age} years old.`);<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p>const personJSON = &#039;{&quot;name&quot;:&quot;John&quot;,&quot;age&quot;:30}&#039;;<\/p>\n<p>const person = Person.fromJSON(personJSON);<\/p>\n<p>person.greet();  \/\/ \u6b63\u5e38\u8c03\u7528\u7c7b\u4e2d\u5b9a\u4e49\u7684\u65b9\u6cd5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4f7f\u7528\u9759\u6001\u65b9\u6cd5<code>fromJSON<\/code>\uff0c\u5e76\u5728\u8be5\u65b9\u6cd5\u5185\u90e8\u8c03\u7528\u7c7b\u7684\u6784\u9020\u51fd\u6570\uff0c\u6211\u4eec\u4e0d\u4ec5\u6062\u590d\u4e86\u5b9e\u4f8b\u7684\u5c5e\u6027\uff0c\u4e5f\u786e\u4fdd\u4e86\u5b9e\u4f8b\u7684\u65b9\u6cd5\uff08\u5982<code>greet<\/code>\uff09\u80fd\u591f\u88ab\u6b63\u786e\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u8fdb\u9636\uff1a\u5904\u7406\u590d\u6742\u7684\u7c7b\u7ed3\u6784<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u7c7b\u7684\u7ed3\u6784\u53ef\u80fd\u4f1a\u66f4\u52a0\u590d\u6742\uff0c\u5305\u62ec\u5d4c\u5957\u5bf9\u8c61\u3001\u6570\u7ec4\u7b49\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6062\u590d\u7c7b\u7684\u5b9e\u4f8b\u53ef\u80fd\u9700\u8981\u66f4\u7ec6\u81f4\u5730\u5904\u7406\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><p>\u5047\u8bbe<code>Person<\/code>\u7c7b\u5305\u542b\u4e86\u4e00\u4e2a\u6216\u591a\u4e2a<code>Address<\/code>\u7c7b\u7684\u5b9e\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">class Address {<\/p>\n<p>  constructor(street, city) {<\/p>\n<p>    this.street = street;<\/p>\n<p>    this.city = city;<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p>class Person {<\/p>\n<p>  constructor(name, age, addresses = []) {<\/p>\n<p>    this.name = name;<\/p>\n<p>    this.age = age;<\/p>\n<p>    this.addresses = addresses;<\/p>\n<p>  }<\/p>\n<p>  addAddress(address) {<\/p>\n<p>    this.addresses.push(address);<\/p>\n<p>  }<\/p>\n<p>  static fromJSON(jsonString) {<\/p>\n<p>    const data = JSON.parse(jsonString);<\/p>\n<p>    const person = new Person(data.name, data.age);<\/p>\n<p>    data.addresses.forEach(addr =&gt; person.addAddress(new Address(addr.street, addr.city)));<\/p>\n<p>    return person;<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u6269\u5c55\u4e86<code>Person<\/code>\u7c7b\uff0c\u4f7f\u5176\u80fd\u591f\u5305\u542b\u591a\u4e2a<code>Address<\/code>\u5b9e\u4f8b\u3002\u901a\u8fc7\u5728<code>fromJSON<\/code>\u65b9\u6cd5\u4e2d\u989d\u5916\u5904\u7406<code>addresses<\/code>\u5c5e\u6027\uff0c\u6211\u4eec\u80fd\u591f\u786e\u4fdd\u5373\u4fbf\u662f\u8fd9\u79cd\u590d\u6742\u7684\u7c7b\u7ed3\u6784\uff0c\u4e5f\u80fd\u4eceJSON\u6b63\u786e\u5730\u6062\u590d\u6210\u5b8c\u6574\u7684\u7c7b\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u8bba\u4e0e\u6700\u4f73\u5b9e\u8df5<\/h3>\n<\/p>\n<p><p>\u4eceJSON\u4f18\u96c5\u5730\u6062\u590d\u7c7b\u7684\u5b9e\u4f8b\uff0c\u65e2\u9700\u8981\u5bf9JSON\u7684\u89e3\u6790\u6709\u6df1\u5165\u7684\u7406\u89e3\uff0c\u4e5f\u9700\u8981\u5bf9JavaScript\u7684\u7c7b\u548c\u539f\u578b\u94fe\u6709\u5145\u5206\u7684\u628a\u63e1\u3002\u901a\u8fc7\u5b9a\u4e49\u9759\u6001\u65b9\u6cd5\uff0c\u6211\u4eec\u80fd\u591f\u7075\u6d3b\u5730\u5904\u7406\u7c7b\u5b9e\u4f8b\u7684\u6062\u590d\uff0c\u800c\u4e0d\u4f1a\u635f\u5931\u7c7b\u539f\u6709\u7684\u884c\u4e3a\u548c\u5c01\u88c5\u6027\u3002\u4e0d\u8fc7\uff0c\u5728\u5904\u7406\u590d\u6742\u7684\u7c7b\u7ed3\u6784\u65f6\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u53d8\u5f97\u66f4\u52a0\u590d\u6742\uff0c\u8981\u6c42\u5f00\u53d1\u8005\u66f4\u52a0\u4ed4\u7ec6\u5730\u8bbe\u8ba1\u6062\u590d\u903b\u8f91\uff0c\u786e\u4fdd\u6bcf\u4e2a\u7ec6\u8282\u90fd\u80fd\u5f97\u5230\u59a5\u5584\u5904\u7406\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u4f7f\u7528JSON\u6062\u590dJavaScript class\u7684\u5b9e\u4f8b\uff1f<\/strong><\/p>\n<p>\u521b\u5efaclass\u7684\u5b9e\u4f8b\u5e76\u5c06\u5176\u5e8f\u5217\u5316\u4e3aJSON\u683c\u5f0f\u662f\u5e38\u89c1\u7684\u64cd\u4f5c\uff0c\u4f46\u662f\u5982\u4f55\u4eceJSON\u6570\u636e\u4e2d\u6062\u590d\u8fd9\u4e9b\u5b9e\u4f8b\u5462\uff1f\u4e0b\u9762\u662f\u4e00\u79cd\u4f18\u96c5\u7684\u6062\u590dclass\u5b9e\u4f8b\u7684\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u9996\u5148\uff0c\u83b7\u53d6\u9700\u8981\u6062\u590d\u7684JSON\u6570\u636e\u3002<\/li>\n<li>\u5c06JSON\u6570\u636e\u8f6c\u6362\u4e3aJavaScript\u5bf9\u8c61\uff0c\u53ef\u4ee5\u901a\u8fc7JSON.parse()\u65b9\u6cd5\u5b9e\u73b0\u3002<\/li>\n<li>\u5982\u679cclass\u4e2d\u5305\u542b\u6709\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5219\u9700\u8981\u5148\u5b9a\u4e49\u4e00\u4e2a\u7c7b\uff0c\u5e76\u5c06\u6062\u590d\u540e\u7684\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u8be5\u7c7b\u7684\u6784\u9020\u51fd\u6570\u3002<\/li>\n<li>\u5c06\u6062\u590d\u540e\u7684\u5bf9\u8c61\u7684\u5c5e\u6027\u503c\u8d4b\u7ed9\u7c7b\u7684\u5b9e\u4f8b\u3002<\/li>\n<li>\u5728\u6062\u590d\u540e\u7684\u5b9e\u4f8b\u4e0a\u8c03\u7528\u81ea\u5b9a\u4e49\u51fd\u6570\u6216\u8005\u6267\u884c\u5176\u4ed6\u64cd\u4f5c\uff0c\u786e\u4fdd\u5b9e\u4f8b\u6062\u590d\u5b8c\u6210\u3002<\/li>\n<\/ol>\n<p><strong>\u5982\u4f55\u89e3\u51b3JavaScript class\u7684\u5b9e\u4f8b\u6062\u590d\u8fc7\u7a0b\u9047\u5230\u7684\u95ee\u9898\uff1f<\/strong><\/p>\n<p>\u5728\u6062\u590dJavaScript class\u7684\u5b9e\u4f8b\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u5982\u679cclass\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6709\u590d\u6742\u7684\u903b\u8f91\u6216\u4f9d\u8d56\u5173\u7cfb\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5de5\u5382\u51fd\u6570\u6765\u521b\u5efa\u5b9e\u4f8b\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u4f7f\u7528new\u5173\u952e\u5b57\u3002\u8fd9\u6837\u53ef\u4ee5\u66f4\u597d\u5730\u63a7\u5236\u5b9e\u4f8b\u7684\u521b\u5efa\u8fc7\u7a0b\uff0c\u4fbf\u4e8e\u6062\u590d\u3002<\/li>\n<li>\u5982\u679cclass\u4e2d\u5305\u542b\u4e86\u4e0d\u53ef\u5e8f\u5217\u5316\u7684\u5c5e\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528\u81ea\u5b9a\u4e49\u7684\u5e8f\u5217\u5316\u65b9\u6cd5\u5c06\u5176\u8f6c\u6362\u4e3a\u53ef\u5e8f\u5217\u5316\u7684\u5f62\u5f0f\uff0c\u4f8b\u5982\u5c06\u51fd\u6570\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002<\/li>\n<li>\u5982\u679cclass\u4e2d\u7684\u5c5e\u6027\u503c\u4f9d\u8d56\u4e8e\u5916\u90e8\u8d44\u6e90\u6216\u73af\u5883\uff0c\u53ef\u4ee5\u5728\u6062\u590d\u5b9e\u4f8b\u65f6\uff0c\u91cd\u65b0\u83b7\u53d6\u8fd9\u4e9b\u8d44\u6e90\u6216\u8005\u91cd\u5efa\u73af\u5883\u3002<\/li>\n<\/ol>\n<p><strong>\u5982\u4f55\u907f\u514dJavaScript class\u7684\u5b9e\u4f8b\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u5b89\u5168\u98ce\u9669\uff1f<\/strong><\/p>\n<p>\u5728\u6062\u590dJavaScript class\u7684\u5b9e\u4f8b\u65f6\uff0c\u6709\u4e00\u4e9b\u5b89\u5168\u98ce\u9669\u9700\u8981\u6ce8\u610f\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5efa\u8bae\uff1a<\/p>\n<ol>\n<li>\u9a8c\u8bc1\u6062\u590d\u7684JSON\u6570\u636e\u7684\u5408\u6cd5\u6027\uff0c\u786e\u4fdd\u6570\u636e\u6765\u81ea\u53ef\u4fe1\u4efb\u7684\u6765\u6e90\uff0c\u5e76\u4e14\u7b26\u5408\u9884\u671f\u7684\u683c\u5f0f\u548c\u7ed3\u6784\u3002<\/li>\n<li>\u4e25\u683c\u63a7\u5236class\u5185\u90e8\u66b4\u9732\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u786e\u4fdd\u53ea\u6062\u590d\u6709\u9650\u7684\u5fc5\u8981\u4fe1\u606f\u3002<\/li>\n<li>\u5bf9\u5b9e\u4f8b\u7684\u6062\u590d\u8fc7\u7a0b\u8fdb\u884c\u4e25\u683c\u7684\u8f93\u5165\u9a8c\u8bc1\u548c\u5b89\u5168\u8fc7\u6ee4\uff0c\u907f\u514d\u53ef\u80fd\u7684\u4ee3\u7801\u6ce8\u5165\u6216\u5176\u4ed6\u5b89\u5168\u5a01\u80c1\u3002<\/li>\n<li>\u907f\u514d\u5728\u6062\u590d\u5b9e\u4f8b\u65f6\u6267\u884c\u5371\u9669\u7684\u64cd\u4f5c\u6216\u8005\u8c03\u7528\u4e0d\u5b89\u5168\u7684\u5916\u90e8\u8d44\u6e90\uff0c\u786e\u4fdd\u5b89\u5168\u6027\u548c\u7a33\u5b9a\u6027\u3002<\/li>\n<\/ol>\n<p>\u5e0c\u671b\u4ee5\u4e0a\u65b9\u6cd5\u548c\u5efa\u8bae\u80fd\u591f\u5e2e\u52a9\u60a8\u5728JavaScript\u4e2d\u4f18\u96c5\u5730\u6062\u590dclass\u7684\u5b9e\u4f8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728JavaScript\u4e2d\uff0c\u4eceJSON\u4f18\u96c5\u5730\u6062\u590d\u7c7b\u7684\u5b9e\u4f8b\u4e3b\u8981\u6d89\u53ca\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a\u89e3\u6790JSON\u5b57\u7b26\u4e32\u3001\u6784\u9020\u7c7b\u5b9e\u4f8b\u3001\u4ee5 [&hellip;]","protected":false},"author":3,"featured_media":171054,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/171045"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=171045"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/171045\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/171054"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=171045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=171045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=171045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}