{"id":1059997,"date":"2024-12-31T15:30:02","date_gmt":"2024-12-31T07:30:02","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1059997.html"},"modified":"2024-12-31T15:30:06","modified_gmt":"2024-12-31T07:30:06","slug":"%e5%a6%82%e4%bd%95%e7%94%a8%e7%b1%bb%e5%88%9b%e5%bb%ba%e6%96%b9%e6%b3%95%e5%9c%a8python%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1059997.html","title":{"rendered":"\u5982\u4f55\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\u5728python\u4e2d"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/9e939c48-df61-4e13-94c9-86faa3cb7be9.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\u5728python\u4e2d\" \/><\/p>\n<p><p> <strong>\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u7c7b\u3001\u521b\u5efa\u5b9e\u4f8b\u3001\u5b9a\u4e49\u65b9\u6cd5\u3001\u8c03\u7528\u65b9\u6cd5\u7b49\u65b9\u5f0f\u5b9e\u73b0<\/strong>\u3002<strong>\u5b9a\u4e49\u7c7b<\/strong>\u662f\u521b\u5efa\u65b9\u6cd5\u7684\u57fa\u7840\uff0c\u901a\u8fc7<strong>\u7c7b\u7684\u5b9e\u4f8b\u5316<\/strong>\u6765\u751f\u6210\u5bf9\u8c61\uff0c<strong>\u5b9a\u4e49\u7c7b\u4e2d\u7684\u65b9\u6cd5<\/strong>\u4ee5\u63d0\u4f9b\u5bf9\u8c61\u7684\u529f\u80fd\uff0c\u6700\u540e\u901a\u8fc7\u5b9e\u4f8b\u5316\u5bf9\u8c61<strong>\u8c03\u7528\u8fd9\u4e9b\u65b9\u6cd5<\/strong>\u3002  <\/p>\n<\/p>\n<p><p>Python\u7684\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff08OOP\uff09\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u7ed3\u6784\u5316\u548c\u6a21\u5757\u5316\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\uff0c\u5e76\u7ed3\u5408\u5b9e\u4f8b\u8fdb\u884c\u8bf4\u660e\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b9a\u4e49\u7c7b<\/h3>\n<\/p>\n<p><p>\u7c7b\u662f\u521b\u5efa\u65b9\u6cd5\u7684\u57fa\u7840\u3002\u5728Python\u4e2d\uff0c\u4f7f\u7528<code>class<\/code>\u5173\u952e\u5b57\u6765\u5b9a\u4e49\u4e00\u4e2a\u7c7b\u3002\u7c7b\u540d\u901a\u5e38\u4f7f\u7528\u9a7c\u5cf0\u547d\u540d\u6cd5\uff0c\u5373\u6bcf\u4e2a\u5355\u8bcd\u7684\u9996\u5b57\u6bcd\u5927\u5199\uff0c\u6bd4\u5982<code>MyClass<\/code>\u3002\u7c7b\u4e2d\u53ef\u4ee5\u5305\u542b\u5c5e\u6027\u548c\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    pass<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u521d\u59cb\u5316\u65b9\u6cd5\uff08\u6784\u9020\u51fd\u6570\uff09<\/h3>\n<\/p>\n<p><p>\u5728\u5b9a\u4e49\u7c7b\u65f6\uff0c\u901a\u5e38\u4f1a\u5b9a\u4e49\u4e00\u4e2a\u7279\u6b8a\u7684\u521d\u59cb\u5316\u65b9\u6cd5<code>__init__<\/code>\uff0c\u7528\u4e8e\u5728\u521b\u5efa\u5b9e\u4f8b\u65f6\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u5c5e\u6027\u3002\u8fd9\u4e2a\u65b9\u6cd5\u662f\u7c7b\u7684\u6784\u9020\u51fd\u6570\uff0c\u5728\u521b\u5efa\u5b9e\u4f8b\u65f6\u81ea\u52a8\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def __init__(self, attribute1, attribute2):<\/p>\n<p>        self.attribute1 = attribute1<\/p>\n<p>        self.attribute2 = attribute2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5b9a\u4e49\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5728\u7c7b\u4e2d\u5b9a\u4e49\u65b9\u6cd5\uff0c\u7528\u4e8e\u5b9e\u73b0\u5bf9\u8c61\u7684\u884c\u4e3a\u3002\u65b9\u6cd5\u662f\u7c7b\u4e2d\u7684\u51fd\u6570\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u901a\u5e38\u662f<code>self<\/code>\uff0c\u7528\u4e8e\u5f15\u7528\u7c7b\u7684\u5b9e\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def __init__(self, attribute1, attribute2):<\/p>\n<p>        self.attribute1 = attribute1<\/p>\n<p>        self.attribute2 = attribute2<\/p>\n<p>    def my_method(self):<\/p>\n<p>        return f&quot;Attribute 1 is {self.attribute1}, Attribute 2 is {self.attribute2}&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u521b\u5efa\u7c7b\u7684\u5b9e\u4f8b<\/h3>\n<\/p>\n<p><p>\u5b9e\u4f8b\u5316\u7c7b\u662f\u521b\u5efa\u5bf9\u8c61\u7684\u8fc7\u7a0b\u3002\u4f7f\u7528\u7c7b\u540d\u52a0\u4e0a\u62ec\u53f7\u6765\u521b\u5efa\u5b9e\u4f8b\uff0c\u5e76\u4f20\u9012\u5fc5\u8981\u7684\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">instance = MyClass(&quot;value1&quot;, &quot;value2&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u8c03\u7528\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u5b9e\u4f8b\u8c03\u7528\u7c7b\u4e2d\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u70b9\u53f7<code>.<\/code>\u6765\u8bbf\u95ee\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">result = instance.my_method()<\/p>\n<p>print(result)  # \u8f93\u51fa: Attribute 1 is value1, Attribute 2 is value2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u793a\u4f8b\uff1a\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u94f6\u884c\u8d26\u6237\u7c7b<\/h3>\n<\/p>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u66f4\u8be6\u7ec6\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5b9a\u4e49\u4e00\u4e2a\u8868\u793a\u94f6\u884c\u8d26\u6237\u7684\u7c7b\uff0c\u5e76\u5305\u542b\u5b58\u6b3e\u548c\u53d6\u6b3e\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class BankAccount:<\/p>\n<p>    def __init__(self, owner, balance=0):<\/p>\n<p>        self.owner = owner<\/p>\n<p>        self.balance = balance<\/p>\n<p>    def deposit(self, amount):<\/p>\n<p>        self.balance += amount<\/p>\n<p>        return f&quot;Deposit of {amount} successful. New balance is {self.balance}&quot;<\/p>\n<p>    def withdraw(self, amount):<\/p>\n<p>        if amount &gt; self.balance:<\/p>\n<p>            return f&quot;Insufficient funds. Current balance is {self.balance}&quot;<\/p>\n<p>        else:<\/p>\n<p>            self.balance -= amount<\/p>\n<p>            return f&quot;Withdrawal of {amount} successful. New balance is {self.balance}&quot;<\/p>\n<p>    def get_balance(self):<\/p>\n<p>        return f&quot;Current balance is {self.balance}&quot;<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u94f6\u884c\u8d26\u6237\u5b9e\u4f8b<\/strong><\/h2>\n<p>account = BankAccount(&quot;Alice&quot;, 1000)<\/p>\n<h2><strong>\u5b58\u6b3e<\/strong><\/h2>\n<p>print(account.deposit(500))  # \u8f93\u51fa: Deposit of 500 successful. New balance is 1500<\/p>\n<h2><strong>\u53d6\u6b3e<\/strong><\/h2>\n<p>print(account.withdraw(200))  # \u8f93\u51fa: Withdrawal of 200 successful. New balance is 1300<\/p>\n<h2><strong>\u67e5\u8be2\u4f59\u989d<\/strong><\/h2>\n<p>print(account.get_balance())  # \u8f93\u51fa: Current balance is 1300<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u7c7b\u7684\u7ee7\u627f<\/h3>\n<\/p>\n<p><p>\u7c7b\u7684\u7ee7\u627f\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u91cd\u8981\u7279\u6027\u3002\u901a\u8fc7\u7ee7\u627f\uff0c\u5b50\u7c7b\u53ef\u4ee5\u91cd\u7528\u7236\u7c7b\u7684\u4ee3\u7801\uff0c\u5e76\u5728\u6b64\u57fa\u7840\u4e0a\u8fdb\u884c\u6269\u5c55\u548c\u4fee\u6539\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class SavingsAccount(BankAccount):<\/p>\n<p>    def __init__(self, owner, balance=0, interest_rate=0.01):<\/p>\n<p>        super().__init__(owner, balance)<\/p>\n<p>        self.interest_rate = interest_rate<\/p>\n<p>    def add_interest(self):<\/p>\n<p>        interest = self.balance * self.interest_rate<\/p>\n<p>        self.balance += interest<\/p>\n<p>        return f&quot;Interest of {interest} added. New balance is {self.balance}&quot;<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u50a8\u84c4\u8d26\u6237\u5b9e\u4f8b<\/strong><\/h2>\n<p>savings_account = SavingsAccount(&quot;Bob&quot;, 2000, 0.05)<\/p>\n<h2><strong>\u6dfb\u52a0\u5229\u606f<\/strong><\/h2>\n<p>print(savings_account.add_interest())  # \u8f93\u51fa: Interest of 100.0 added. New balance is 2100<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u7c7b\u7684\u5c01\u88c5\u4e0e\u79c1\u6709\u5c5e\u6027<\/h3>\n<\/p>\n<p><p>\u5728\u7c7b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u53cc\u4e0b\u5212\u7ebf<code>__<\/code>\u6765\u5b9a\u4e49\u79c1\u6709\u5c5e\u6027\uff0c\u9632\u6b62\u5916\u90e8\u76f4\u63a5\u8bbf\u95ee\u3002\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u516c\u5171\u65b9\u6cd5\u6765\u8bbf\u95ee\u548c\u4fee\u6539\u79c1\u6709\u5c5e\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class EncapsulatedAccount:<\/p>\n<p>    def __init__(self, owner, balance=0):<\/p>\n<p>        self.__owner = owner<\/p>\n<p>        self.__balance = balance<\/p>\n<p>    def deposit(self, amount):<\/p>\n<p>        self.__balance += amount<\/p>\n<p>        return f&quot;Deposit of {amount} successful. New balance is {self.__balance}&quot;<\/p>\n<p>    def withdraw(self, amount):<\/p>\n<p>        if amount &gt; self.__balance:<\/p>\n<p>            return f&quot;Insufficient funds. Current balance is {self.__balance}&quot;<\/p>\n<p>        else:<\/p>\n<p>            self.__balance -= amount<\/p>\n<p>            return f&quot;Withdrawal of {amount} successful. New balance is {self.__balance}&quot;<\/p>\n<p>    def get_balance(self):<\/p>\n<p>        return f&quot;Current balance is {self.__balance}&quot;<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5c01\u88c5\u7684\u8d26\u6237\u5b9e\u4f8b<\/strong><\/h2>\n<p>encapsulated_account = EncapsulatedAccount(&quot;Charlie&quot;, 3000)<\/p>\n<h2><strong>\u5c1d\u8bd5\u76f4\u63a5\u8bbf\u95ee\u79c1\u6709\u5c5e\u6027\uff08\u4f1a\u62a5\u9519\uff09<\/strong><\/h2>\n<h2><strong>print(encapsulated_account.__balance)<\/strong><\/h2>\n<h2><strong>\u901a\u8fc7\u65b9\u6cd5\u8bbf\u95ee\u79c1\u6709\u5c5e\u6027<\/strong><\/h2>\n<p>print(encapsulated_account.get_balance())  # \u8f93\u51fa: Current balance is 3000<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e5d\u3001\u7c7b\u65b9\u6cd5\u548c\u9759\u6001\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u7c7b\u65b9\u6cd5\u4f7f\u7528<code>@classmethod<\/code>\u88c5\u9970\u5668\u5b9a\u4e49\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f<code>cls<\/code>\uff0c\u8868\u793a\u7c7b\u672c\u8eab\u3002\u9759\u6001\u65b9\u6cd5\u4f7f\u7528<code>@staticmethod<\/code>\u88c5\u9970\u5668\u5b9a\u4e49\uff0c\u4e0d\u9700\u8981\u4f20\u9012<code>self<\/code>\u6216<code>cls<\/code>\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    class_variable = &quot;class variable value&quot;<\/p>\n<p>    def __init__(self, instance_variable):<\/p>\n<p>        self.instance_variable = instance_variable<\/p>\n<p>    @classmethod<\/p>\n<p>    def class_method(cls):<\/p>\n<p>        return f&quot;Class method called. Class variable is {cls.class_variable}&quot;<\/p>\n<p>    @staticmethod<\/p>\n<p>    def static_method():<\/p>\n<p>        return &quot;Static method called&quot;<\/p>\n<h2><strong>\u8c03\u7528\u7c7b\u65b9\u6cd5<\/strong><\/h2>\n<p>print(MyClass.class_method())  # \u8f93\u51fa: Class method called. Class variable is class variable value<\/p>\n<h2><strong>\u8c03\u7528\u9759\u6001\u65b9\u6cd5<\/strong><\/h2>\n<p>print(MyClass.static_method())  # \u8f93\u51fa: Static method called<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5341\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\u5728Python\u4e2d\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u6838\u5fc3\u3002\u901a\u8fc7\u5b9a\u4e49\u7c7b\u3001\u521b\u5efa\u5b9e\u4f8b\u3001\u5b9a\u4e49\u65b9\u6cd5\u3001\u8c03\u7528\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4ee3\u7801\u7684\u6a21\u5757\u5316\u548c\u91cd\u7528\u6027\u3002\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u8fd8\u5305\u62ec\u7c7b\u7684\u7ee7\u627f\u3001\u5c01\u88c5\u4ee5\u53ca\u7c7b\u65b9\u6cd5\u548c\u9759\u6001\u65b9\u6cd5\u7684\u4f7f\u7528\uff0c\u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u7075\u6d3b\u548c\u6613\u4e8e\u7ef4\u62a4\u3002\u638c\u63e1\u8fd9\u4e9b\u6982\u5ff5\u548c\u6280\u5de7\uff0c\u5c06\u6709\u52a9\u4e8e\u4f60\u5728Python\u7f16\u7a0b\u4e2d\u7f16\u5199\u66f4\u9ad8\u6548\u548c\u7ed3\u6784\u5316\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9a\u4e49\u548c\u4f7f\u7528\u7c7b\u7684\u65b9\u6cd5\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u7c7b\u7684\u65b9\u6cd5\u662f\u5c01\u88c5\u5728\u7c7b\u5185\u90e8\u7684\u51fd\u6570\u3002\u8981\u5b9a\u4e49\u4e00\u4e2a\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5728\u7c7b\u5185\u90e8\u4f7f\u7528<code>def<\/code>\u5173\u952e\u5b57\uff0c\u5e76\u786e\u4fdd\u65b9\u6cd5\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f<code>self<\/code>\uff0c\u8fd9\u4ee3\u8868\u7c7b\u7684\u5b9e\u4f8b\u3002\u8c03\u7528\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u4f8b\u8bbf\u95ee\u5b83\uff0c\u4f8b\u5982\uff1a<code>\u5b9e\u4f8b\u540d.\u65b9\u6cd5\u540d()<\/code>\u3002<\/p>\n<p><strong>\u7c7b\u7684\u65b9\u6cd5\u4e0e\u51fd\u6570\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>\u7c7b\u7684\u65b9\u6cd5\u662f\u4e0e\u7c7b\u7684\u5b9e\u4f8b\u76f8\u5173\u8054\u7684\uff0c\u800c\u666e\u901a\u51fd\u6570\u5219\u662f\u72ec\u7acb\u7684\u3002\u65b9\u6cd5\u53ef\u4ee5\u8bbf\u95ee\u5b9e\u4f8b\u7684\u5c5e\u6027\u5e76\u5bf9\u5176\u8fdb\u884c\u4fee\u6539\uff0c\u8fd9\u4f7f\u5f97\u5b83\u4eec\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\u66f4\u4e3a\u5f3a\u5927\u3002\u4f8b\u5982\uff0c\u65b9\u6cd5\u53ef\u4ee5\u901a\u8fc7<code>self<\/code>\u8bbf\u95ee\u548c\u4fee\u6539\u7c7b\u7684\u5b9e\u4f8b\u53d8\u91cf\uff0c\u800c\u72ec\u7acb\u51fd\u6570\u65e0\u6cd5\u505a\u5230\u8fd9\u4e00\u70b9\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u7c7b\u4e2d\u4f7f\u7528\u9759\u6001\u65b9\u6cd5\u548c\u7c7b\u65b9\u6cd5\uff1f<\/strong><br \/>\u9759\u6001\u65b9\u6cd5\u4f7f\u7528<code>@staticmethod<\/code>\u88c5\u9970\u5668\u5b9a\u4e49\uff0c\u4e0d\u9700\u8981<code>self<\/code>\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u4e0d\u4f9d\u8d56\u7c7b\u5b9e\u4f8b\u7684\u60c5\u51b5\u4e0b\u8c03\u7528\u3002\u7c7b\u65b9\u6cd5\u4f7f\u7528<code>@classmethod<\/code>\u88c5\u9970\u5668\u5b9a\u4e49\uff0c\u63a5\u53d7\u7c7b\u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u53c2\u6570\uff08\u901a\u5e38\u547d\u540d\u4e3a<code>cls<\/code>\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7\u7c7b\u672c\u8eab\u8c03\u7528\uff0c\u9002\u5408\u4e8e\u9700\u8981\u8bbf\u95ee\u7c7b\u5c5e\u6027\u7684\u60c5\u51b5\u3002\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u4e3a\u4ee3\u7801\u7ed3\u6784\u63d0\u4f9b\u4e86\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u7528\u7c7b\u521b\u5efa\u65b9\u6cd5\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49\u7c7b\u3001\u521b\u5efa\u5b9e\u4f8b\u3001\u5b9a\u4e49\u65b9\u6cd5\u3001\u8c03\u7528\u65b9\u6cd5\u7b49\u65b9\u5f0f\u5b9e\u73b0\u3002\u5b9a\u4e49\u7c7b\u662f\u521b\u5efa\u65b9\u6cd5\u7684\u57fa\u7840\uff0c [&hellip;]","protected":false},"author":3,"featured_media":1060008,"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\/1059997"}],"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=1059997"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1059997\/revisions"}],"predecessor-version":[{"id":1060011,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1059997\/revisions\/1060011"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1060008"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1059997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1059997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1059997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}