{"id":3087,"date":"2018-09-18T15:36:57","date_gmt":"2018-09-18T07:36:57","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3087"},"modified":"2018-09-18T15:36:57","modified_gmt":"2018-09-18T07:36:57","slug":"%e8%bf%99%e6%a0%b7%e4%bd%bf%e7%94%a8-threadlocal-%e5%af%b9%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3087","title":{"rendered":"\u8fd9\u6837\u4f7f\u7528 ThreadLocal \u5bf9\u5417\uff1f"},"content":{"rendered":"<p>\n\t\u6700\u8fd1\u6211\u770b\u5230\u540c\u4e8b\u518d\u7528 ThreadLocal\uff0c\u4ed6\u6ca1\u7528\u51fa\u60f3\u8981\u7684\u6548\u679c\u5c31\u6765\u54a8\u8be2\u6211\uff0c\u7136\u540e\u6211\u5927\u6982\u89e3\u91ca\u4e86\u4e00\u4e0b\uff0c\u7136\u540e\u8fde\u6211\u81ea\u5df1\u90fd\u7cca\u6d82\u4e86\u3002\u6240\u4ee5\u8d81\u673a\u53c8\u770b\u4e86\u4e00\u4e0b\u300a\u6df1\u5165\u7406\u89e3java\u865a\u62df\u673a\u300b\u8fd9\u672c\u4e66\uff0c\u4e0b\u9762\u8bf4\u4e00\u8bf4\u6211\u4e2a\u4eba\u5bf9 ThreadLocal \u7684\u7406\u89e3\uff0c\u89e3\u91ca\u6709\u8bef\u7684\u5730\u65b9\u8bf7\u7559\u8a00\u6307\u6b63\uff01\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"ThreadLocal\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/threadlocal.jpg\" style=\"width: 1534px;height: 1291px\" \/>\n<\/p>\n<p>\n\t\u8981\u7406\u89e3 ThreadLocal\uff0c\u5148\u6765\u770b\u770b\u5b98\u65b9\u5bf9\u5b83\u7684\u89e3\u91ca\uff1a\n<\/p>\n<p>\n\tThis class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its {@code get} or {@code set} method) has its own, independently initialized copy of the variable. {@code ThreadLocal} instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID).\n<\/p>\n<p>\n\t\u6211\u7ffb\u8bd1\u4e00\u4e0b\uff0c\u5927\u6982\u610f\u601d\u662f\u8fd9\u6837\uff08\u53ef\u80fd\u7ffb\u8bd1\u7684\u4e0d\u662f\u5f88\u51c6\u786e\uff0c\u89c1\u8c05\uff09\uff1a\n<\/p>\n<blockquote>\n<p>\n\t\t\u8be5\u7c7b\u63d0\u4f9b\u4e86\u7ebf\u7a0b\u5c40\u90e8 (thread-local) \u53d8\u91cf\u3002\u8fd9\u4e9b\u53d8\u91cf\u4e0d\u540c\u4e8e\u5b83\u4eec\u7684\u666e\u901a\u5bf9\u5e94\u7269\uff0c\u56e0\u4e3a\u8bbf\u95ee\u67d0\u4e2a\u53d8\u91cf\uff08\u901a\u8fc7\u5176 get \u6216 set \u65b9\u6cd5\uff09\u7684\u6bcf\u4e2a\u7ebf\u7a0b\u90fd\u6709\u81ea\u5df1\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u5b83\u72ec\u7acb\u4e8e\u53d8\u91cf\u7684\u521d\u59cb\u5316\u526f\u672c\u3002ThreadLocal \u5b9e\u4f8b\u901a\u5e38\u662f\u7c7b\u4e2d\u7684 private static \u5b57\u6bb5\uff0c\u5b83\u4eec\u5e0c\u671b\u5c06\u72b6\u6001\u4e0e\u67d0\u4e00\u4e2a\u7ebf\u7a0b\uff08\u4f8b\u5982\uff0c\u7528\u6237 ID \u6216\u4e8b\u52a1 ID\uff09\u76f8\u5173\u8054\u3002\n\t<\/p>\n<\/blockquote>\n<p>\n\t\u603b\u7ed3\u4e00\u4e0b\u91cd\u70b9\uff1a\n<\/p>\n<ul>\n<li>\n\t\tThreadLocal \u63d0\u4f9b\u4e86\u4e00\u79cd\u8bbf\u95ee\u67d0\u4e2a\u53d8\u91cf\u7684\u7279\u6b8a\u65b9\u5f0f\uff1a\u8bbf\u95ee\u5230\u7684\u53d8\u91cf\u5c5e\u4e8e\u5f53\u524d\u7ebf\u7a0b\uff0c\u5373\u4fdd\u8bc1\u6bcf\u4e2a\u7ebf\u7a0b\u7684\u53d8\u91cf\u4e0d\u4e00\u6837\uff0c\u800c\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5728\u4efb\u4f55\u5730\u65b9\u62ff\u5230\u7684\u53d8\u91cf\u90fd\u662f\u5f53\u524d\u8fd9\u4e2a\u7ebf\u7a0b\u79c1\u6709\u7684\uff0c\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u7ebf\u7a0b\u9694\u79bb\u3002\n\t<\/li>\n<li>\n\t\t\u5982\u679c\u8981\u4f7f\u7528 ThreadLocal\uff0c\u901a\u5e38\u5b9a\u4e49\u4e3a private static \u7c7b\u578b\uff0c\u5728\u6211\u770b\u6765\u6700\u597d\u662f\u5b9a\u4e49\u4e3a private static final \u7c7b\u578b\u3002\n\t<\/li>\n<\/ul>\n<p>\n\t\u7406\u89e3\u4e86 ThreadLocal\uff0c\u6211\u4eec\u6765\u770b ThreadLocal \u7684\u4f7f\u7528\u573a\u666f\uff1a\n<\/p>\n<p>\n\t\u5bf9\u540c\u4e00\u4e2a\u7ebf\u7a0b\u8c03\u7528\u7684\u591a\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u5171\u4eab\u4e86\u67d0\u4e00\u4e2a\u53d8\u91cf\uff0c\u8fd9\u4e2a\u53d8\u91cf\u9700\u8981\u4f20\u9012\u5230\u591a\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u8fd9\u6837\u4f20\u6765\u4f20\u53bb\u592a\u9ebb\u70e6\u4e86\uff0c\u8fd9\u65f6\u5c31\u53ef\u4ee5\u91c7\u7528 ThreadLocal \u4e86\u3002\n<\/p>\n<p>\n\t\u4e0b\u9762\u6211\u4eec\u6765\u770b\u4e00\u4e2a\u9519\u8bef\u7684\u7528\u6cd5\u3002\u5148\u521b\u5efa\u4e00\u4e2a\u7528\u6765\u4f5c\u4e3a\u5171\u4eab\u53d8\u91cf\u7684\u5b9e\u4f53\u7c7b\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.test;\r\n\r\npublic class Xttblog {\r\n    private String title;\r\n    private Long id;\r\n    private String text;\r\n\r\n    public String getTitle() {\r\n        return title;\r\n    }\r\n\r\n    public void setTitle(String title) {\r\n        this.title = title;\r\n    }\r\n\r\n    public Long getId() {\r\n        return id;\r\n    }\r\n\r\n    public void setId(Long id) {\r\n        this.id = id;\r\n    }\r\n\r\n    public String getText() {\r\n        return text;\r\n    }\r\n\r\n    public void setText(String text) {\r\n        this.text = text;\r\n    }\r\n\r\n    public Xttblog(String title, Long id, String text) {\r\n        this.title = title;\r\n        this.id = id;\r\n        this.text = text;\r\n    }\r\n}<\/pre>\n<p>\n\t\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u7ebf\u7a0b ThreadLocalTarget\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.test;\r\n\r\npublic class ThreadLocalTarget implements Runnable{\r\n&nbsp; &nbsp; private static Xttblog blog = new Xttblog(&quot;ThreadLocal \u4f1a\u5bfc\u81f4\u5185\u5b58\u6cc4\u9732\uff1f&quot;,1L,&quot;....&quot;);\r\n&nbsp; &nbsp; public static ThreadLocal&lt;Xttblog&gt; local = new ThreadLocal&lt;Xttblog&gt;();\r\n&nbsp; &nbsp; public ThreadLocalTarget(){}\r\n\r\n&nbsp; &nbsp; @Override\r\n&nbsp; &nbsp; public void run() {\r\n&nbsp; &nbsp; &nbsp; &nbsp; ThreadLocalTarget.local.set(blog);\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; ThreadLocalTarget.local.get().setTitle(&quot;test&quot;);\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(Thread.currentThread().getName() + &quot;\u66f4\u6539\u540e\u7684\u540d\u5b57\uff1a&quot; + ThreadLocalTarget.local.get().getTitle());\r\n&nbsp; &nbsp; }\r\n\r\n&nbsp; &nbsp; public static Xttblog getBlog() {\r\n&nbsp; &nbsp; &nbsp; &nbsp; return blog;\r\n&nbsp; &nbsp; }\r\n}<\/pre>\n<p>\n\t\u7136\u540e\u6a21\u4eff\u8fd9\u4e2a\u7ebf\u7a0b\u5728\u5b9e\u9645\u4e2d\u7684\u5e94\u7528\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.test;\r\n\r\npublic class ThreadLocalTest {\r\n&nbsp; &nbsp; public static void main(String[] args) throws InterruptedException {\r\n&nbsp; &nbsp; &nbsp; &nbsp; ThreadLocalTarget target = new ThreadLocalTarget();\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; Thread thread = new Thread(target);\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; thread.start();\r\n&nbsp; &nbsp; &nbsp; &nbsp; thread.join();\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(Thread.currentThread().getName() + &quot;\u66f4\u6539\u540e\u7684\u540d\u5b57\uff1a&quot; + ThreadLocalTarget.getBlog().getTitle());\r\n&nbsp; &nbsp; }\r\n}<\/pre>\n<p>\n\t\u8fd0\u884c ThreadLocalTest \u4e4b\u540e\uff0c\u4f60\u4f1a\u50bb\u773c\u4e86\u3002ThreadLocal \u4e0d\u662f\u5171\u4eab\u53d8\u91cf\uff0c\u662f\u62f7\u8d1d\u7684\u53d8\u91cf\u7684\u4e00\u4e2a\u526f\u672c\u5417\uff1f\u600e\u4e48\u53d8\u91cf\u7684\u503c\u6700\u7ec8\u88ab\u6539\u53d8\u4e86\u3002\n<\/p>\n<pre class=\"brush:plain;\">\r\nThread-0\u66f4\u6539\u540e\u7684\u540d\u5b57\uff1atest\r\nmain\u66f4\u6539\u540e\u7684\u540d\u5b57\uff1atest<\/pre>\n<p>\n\t\u8fd9\u4e0d\u662f ThreadLocal \u7684\u9519\uff0c\u662f\u4f60\u6ca1\u7406\u89e3\u5979\u3002\n<\/p>\n<p>\n\t\u6211\u524d\u9762\u8bf4\u8fc7 ThreadLocal \u4fdd\u8bc1\u7684\u662f\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5185\u90e8\u8c03\u7528\u7684\u5404\u79cd\u65b9\u6cd5\u5171\u4eab\u5f53\u524d\u7ebf\u7a0b\u4e2d ThreadLocal \u7684\u53d8\u91cf\u3002\u5c31\u662f\u8bf4\u9488\u5bf9\u540c\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\u4efb\u4f55\u5730\u65b9\u8bbf\u95ee\u5c5e\u4e8e\u5f53\u524d\u73b0\u5728\u7684\u5171\u4eab\u53d8\u91cf\u662f\u540c\u4e00\u4e2a\u3002\u4ece\u4e0a\u9762\u4e5f\u53ef\u4ee5\u770b\u51fa ThreadLocal \u4e0d\u662f\u62f7\u8d1d\u7684\u53d8\u91cf\u7684\u526f\u672c\u3002\n<\/p>\n<p>\n\t\u8fd8\u6ca1\u660e\u767d\uff08\u4e5f\u8bb8\u662f\u6211\u6ca1\u8bf4\u6e05\u695a\uff09\uff0c\u6211\u4eec\u6765\u770b\u770b\u963f\u91cc\u5df4\u5df4 java \u5f00\u53d1\u624b\u518c\u4e2d\u63a8\u8350\u7684 ThreadLocal \u7684\u7528\u6cd5\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npackage com.xttblog.test;\r\n\r\nimport java.text.DateFormat;\r\nimport java.text.SimpleDateFormat;\r\n\r\npublic class DateUtil {\r\n    public static final ThreadLocal&lt;DateFormat&gt; threadLocal = new ThreadLocal&lt;DateFormat&gt;(){\r\n        @Override\r\n        protected DateFormat initialValue() {\r\n            return new SimpleDateFormat(&quot;yyyy-MM-dd&quot;);\r\n        }\r\n    };\r\n}<\/pre>\n<p>\n\t\u7136\u540e\u6211\u4eec\u518d\u8981\u7528\u5230 DateFormat \u5bf9\u8c61\u7684\u5730\u65b9\uff0c\u8fd9\u6837\u8c03\u7528\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nDateUtils.df.get().format(new Date());<\/pre>\n<p>\n\t\u5982\u679c\u8fd8\u6ca1\u660e\u767d\uff0c\u6211\u518d\u89e3\u91ca\u4e00\u4e0b\uff0cThreadLocal \u76f8\u5f53\u4e8e\u6bcf\u4e2a\u7ebf\u7a0bA\u5728\u521b\u5efa\u7684\u65f6\u5019\uff0c\u5df2\u7ecf\u4e3a\u4f60\u521b\u5efa\u597d\u4e86\u4e00\u4e2a DateFormat\uff0c\u8fd9\u4e2a DateFormat \u5728\u5f53\u524d\u8fd9\u4e2a\u7ebf\u7a0bA\u4e2d\u5171\u4eab\u3002\u5176\u4ed6\u7ebf\u7a0bB\uff0c\u518d\u7528\u5230 DateFormat \u7684\u5730\u65b9\uff0c\u4e5f\u4f1a\u521b\u5efa\u4e00\u4e2a DateFormat \u5bf9\u8c61\uff0c\u8fd9\u4e2a\u5bf9\u8c61\u4f1a\u5728\u7ebf\u7a0b B \u4e2d\u5171\u4eab\uff0c\u76f4\u5230\u7ebf\u7a0b B \u7ed3\u675f\u3002\n<\/p>\n<p>\n\t\u4e5f\u5c31\u662f\u8bf4 ThreadLocal \u7684\u7528\u6cd5\u548c\u6211\u4eec\u81ea\u5df1 new \u5bf9\u8c61\u4e00\u6837\uff0c\u7136\u540e\u5c06\u8fd9\u4e2a new \u7684\u5bf9\u8c61\u4f20\u9012\u5230\u5404\u4e2a\u65b9\u6cd5\u4e2d\u3002\u4f46\u662f\u5230\u5904\u4f20\u9012\u7684\u8bdd\uff0c\u592a\u9ebb\u70e6\u4e86\u3002\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u5e94\u8be5\u7528 ThreadLocal\u3002\n<\/p>\n<p>\n\t\u603b\u7ed3\uff1a<span style=\"color:#B22222\"><strong>ThreadLocal \u5e76\u4e0d\u662f\u4e3a\u4e86\u89e3\u51b3\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u800c\u662f\u63d0\u4f9b\u4e86\u4e00\u79cd\u5c06\u5b9e\u4f8b\u7ed1\u5b9a\u5230\u5f53\u524d\u7ebf\u7a0b\u7684\u673a\u5236\uff0c\u7c7b\u4f3c\u4e8e\u9694\u79bb\u7684\u6548\u679c\uff0c\u5b9e\u9645\u4e0a\u81ea\u5df1\u5728\u65b9\u6cd5\u4e2d new \u51fa\u6765\u53d8\u91cf\u4e5f\u80fd\u8fbe\u5230\u7c7b\u4f3c\u7684\u6548\u679c\u3002ThreadLocal \u8ddf\u7ebf\u7a0b\u5b89\u5168\u57fa\u672c\u4e0d\u642d\u8fb9\uff0c\u7ed1\u5b9a\u4e0a\u53bb\u7684\u5b9e\u4f8b\u4e5f\u4e0d\u662f\u591a\u7ebf\u7a0b\u516c\u7528\u7684\uff0c\u800c\u662f\u6bcf\u4e2a\u7ebf\u7a0b new \u4e00\u4efd\uff0c\u8fd9\u4e2a\u5b9e\u4f8b\u80af\u5b9a\u4e0d\u662f\u5171\u7528\u7684\uff0c\u5982\u679c\u5171\u7528\u4e86\uff0c\u90a3\u5c31\u4f1a\u5f15\u53d1\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\u3002ThreadLocal \u6700\u5927\u7684\u7528\u5904\u5c31\u662f\u7528\u6765\u628a\u5b9e\u4f8b\u53d8\u91cf\u5171\u4eab\u6210\u5168\u5c40\u53d8\u91cf\uff0c\u5728\u7a0b\u5e8f\u7684\u4efb\u4f55\u65b9\u6cd5\u4e2d\u90fd\u53ef\u4ee5\u8bbf\u95ee\u5230\u8be5\u5b9e\u4f8b\u53d8\u91cf\u800c\u5df2\u3002\u7f51\u4e0a\u5f88\u591a\u4eba\u8bf4 ThreadLocal \u662f\u89e3\u51b3\u4e86\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u5176\u5b9e\u662f\u671b\u6587\u751f\u4e49\uff0c\u4e24\u8005\u4e0d\u662f\u540c\u7c7b\u95ee\u9898<\/strong><\/span>\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3087\">\u8fd9\u6837\u4f7f\u7528 ThreadLocal \u5bf9\u5417\uff1f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u6211\u770b\u5230\u540c\u4e8b\u518d\u7528 ThreadLocal\uff0c\u4ed6\u6ca1\u7528\u51fa\u60f3\u8981\u7684\u6548\u679c\u5c31\u6765\u54a8\u8be2\u6211\uff0c\u7136\u540e\u6211\u5927\u6982\u89e3\u91ca\u4e86\u4e00\u4e0b\uff0c\u7136\u540e\u8fde\u6211\u81ea\u5df1\u90fd [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[565,567,532,568,505],"class_list":["post-3087","post","type-post","status-publish","format-standard","hentry","category-java","tag-java-","tag-threadlocal","tag-568","tag-505"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3087"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3087\/revisions"}],"predecessor-version":[{"id":3088,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3087\/revisions\/3088"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}