{"id":593,"date":"2023-03-23T21:28:47","date_gmt":"2023-03-23T13:28:47","guid":{"rendered":""},"modified":"2023-03-23T21:28:47","modified_gmt":"2023-03-23T13:28:47","slug":"Spring Boot\u7f13\u5b58","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/593.html","title":{"rendered":"Spring Boot\u7f13\u5b58"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

Spring Boot\u7f13\u5b58<\/h1>\n<\/p><\/div>\n
\n Spring\u6846\u67b6\u900f\u660e\u5730\u5728Spring\u5e94\u7528\u7a0b\u5e8f\u4e2d\u63d0\u4f9b\u7f13\u5b58\u3002\u5728Spring\u4e2d\uff0c
\n \u7f13\u5b58\u62bd\u8c61<\/strong>\u662f\u4e00\u79cd\u673a\u5236\uff0c\u5b83\u5141\u8bb8\u5728\u4e0d\u5f71\u54cd\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u4e00\u81f4\u4f7f\u7528\u5404\u79cd\u7f13\u5b58\u65b9\u6cd5\u3002\n <\/div>\n

\u7f13\u5b58\u62bd\u8c61<\/h2>\n
\n \u7f13\u5b58\u62bd\u8c61\u673a\u5236\u9002\u7528\u4e8e
\n Java \u65b9\u6cd5<\/strong>\u3002\u4f7f\u7528\u7f13\u5b58\u62bd\u8c61\u7684\u4e3b\u8981\u76ee\u7684\u662f\u6839\u636e\u7f13\u5b58\u4e2d\u5b58\u5728\u7684\u4fe1\u606f
\n \u51cf\u5c11<\/strong>\u6267\u884c\u6b21\u6570\u3002\u5b83\u9002\u7528\u4e8e\u6602\u8d35\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982
\n CPU <\/strong>\u6216
\n IO\u7ed1\u5b9a\u3002<\/strong>\n <\/div>\n
\n \u6bcf\u6b21\u8c03\u7528\u65b9\u6cd5\u65f6\uff0c\u62bd\u8c61\u90fd\u4f1a\u5c06\u7f13\u5b58\u884c\u4e3a\u5e94\u7528\u4e8e\u8be5\u65b9\u6cd5\u3002\u5b83\u68c0\u67e5\u8be5\u65b9\u6cd5\u662f\u5426\u5df2\u7ecf\u9488\u5bf9\u7ed9\u5b9a\u53c2\u6570\u6267\u884c\u3002\n <\/div>\n

\u5982\u679c\u662f\uff0c\u5219\u4e0d\u6267\u884c\u5b9e\u9645\u65b9\u6cd5\u5c31\u8fd4\u56de\u7f13\u5b58\u7684\u7ed3\u679c\u3002<\/span>
\n \u5982\u679c\u5426\uff0c\u5219\u9996\u5148\u6267\u884c\u8be5\u65b9\u6cd5\uff0c\u5e76\u5c06\u7ed3\u679c\u7f13\u5b58\u5e76\u8fd4\u56de\u7ed9\u7528\u6237\u3002<\/span> <\/p>\n

\n \u6ce8\u610f: <\/span>\u6b64\u65b9\u6cd5\u4ec5\u9002\u7528\u4e8e\u4fdd\u8bc1\u4e3a\u7ed9\u5b9a\u8f93\u5165\u8fd4\u56de\u76f8\u540c\u7ed3\u679c\u7684\u65b9\u6cd5\u3002\u8be5\u65b9\u6cd5\u6267\u884c\u591a\u5c11\u6b21\u5e76\u4e0d\u91cd\u8981\u3002\n <\/div>\n
\n \u5f00\u53d1\u4eba\u5458\u5728\u5904\u7406\u7f13\u5b58\u62bd\u8c61\u65f6\u4f1a\u6ce8\u610f\u4e24\u4ef6\u4e8b\u3002\n <\/div>\n

\u7f13\u5b58\u58f0\u660e<\/strong>: \u5b83\u6807\u8bc6\u9700\u8981\u7f13\u5b58\u7684\u65b9\u6cd5\u3002<\/span>
\n \u7f13\u5b58\u914d\u7f6e: <\/strong>\u7528\u4e8e\u5b58\u50a8\u548c\u8bfb\u53d6\u6570\u636e\u7684\u540e\u5907\u7f13\u5b58\u3002<\/span> <\/p>\n

\u7f13\u5b58<\/h3>\n
\n \u7f13\u5b58\u662f\u4e34\u65f6\u5185\u5b58\u7684\u4e00\u90e8\u5206( RAM )\u3002\u5b83\u4f4d\u4e8e\u5e94\u7528\u7a0b\u5e8f\u548c\u6301\u4e45\u6027\u6570\u636e\u5e93\u4e4b\u95f4\u3002\u5b83\u5b58\u50a8\u6700\u8fd1\u4f7f\u7528\u7684\u6570\u636e\uff0c\u4ece\u800c\u5c3d\u53ef\u80fd\u51cf\u5c11\u6570\u636e\u5e93\u547d\u4e2d\u6b21\u6570\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u7f13\u5b58\u662f\u4e3a\u4e86\u5b58\u50a8\u6570\u636e\u4ee5\u4f9b\u5c06\u6765\u53c2\u8003\u3002\n <\/div>\n

\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528\u7f13\u5b58\uff1f<\/h2>\n
\n \u4f7f\u7528\u7f13\u5b58\u7684\u4e3b\u8981\u539f\u56e0\u662f\u4e3a\u4e86\u8fdb\u884c\u6570\u636e\u8bbf\u95ee\u66f4\u5feb\uff0c\u66f4\u4fbf\u5b9c\u3002\u5f53\u591a\u6b21\u8bf7\u6c42\u9ad8\u5ea6\u8bf7\u6c42\u7684\u8d44\u6e90\u65f6\uff0c\u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\uff0c\u7f13\u5b58\u8d44\u6e90\u901a\u5e38\u662f\u6709\u76ca\u7684\uff0c\u8fd9\u6837\u5b83\u53ef\u4ee5\u5feb\u901f\u7ed9\u51fa\u54cd\u5e94\u3002\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u7f13\u5b58\u53ef\u4ee5\u589e\u5f3a\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u4e0e\u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6\u6570\u636e\u76f8\u6bd4\uff0c\u4ece\u5185\u5b58\u8fdb\u884c\u6570\u636e\u8bbf\u95ee\u603b\u662f\u66f4\u5feb\u3002\u5b83\u964d\u4f4e\u4e86\u8d27\u5e01\u6210\u672c\u548c\u673a\u4f1a\u6210\u672c\u3002\n <\/div>\n

\u5e94\u7f13\u5b58\u54ea\u4e9b\u6570\u636e\uff1f<\/h2>\n

\u4e0d\u7ecf\u5e38\u66f4\u6539\u7684\u6570\u636e\u3002<\/span>
\n \u7ecf\u5e38\u4f7f\u7528\u7684\u8bfb\u53d6\u67e5\u8be2\uff0c\u5176\u67e5\u8be2\u7ed3\u679c\u5728\u6bcf\u4e2a\u8c03\u7528\u4e2d\u81f3\u5c11\u4e00\u6bb5\u65f6\u95f4\u6ca1\u6709\u53d8\u5316\u3002<\/span> <\/p>\n

\u7f13\u5b58\u7c7b\u578b<\/h2>\n
\n \u6709
\n \u56db\u79cd<\/strong>\u7f13\u5b58\u7c7b\u578b\u5982\u4e0b:\n <\/div>\n

\u5185\u5b58\u4e2d\u7f13\u5b58<\/span>
\n \u6570\u636e\u5e93\u7f13\u5b58<\/span>
\n Web\u670d\u52a1\u5668\u7f13\u5b58<\/span>
\n CDN\u7f13\u5b58<\/span> <\/p>\n

\u5185\u5b58\u7f13\u5b58<\/h3>\n
\n \u5185\u5b58\u7f13\u5b58\u53ef\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u8fd9\u662f\u7ecf\u5e38\u4f7f\u7528\u7684\u533a\u57df\u3002
\n Memcached <\/strong>\u548c
\n Redis <\/strong>\u662f\u5185\u5b58\u4e2d\u7f13\u5b58\u7684\u793a\u4f8b\u3002\u5b83\u5728\u5e94\u7528\u7a0b\u5e8f\u548c\u6570\u636e\u5e93\u4e4b\u95f4\u5b58\u50a8\u952e\u503c\u3002 Redis\u662f\u4e00\u79cd
\n \u5185\u5b58\u4e2d\uff0c\u5206\u5e03\u5f0f<\/strong>\u9ad8\u7ea7\u7f13\u5b58\u5de5\u5177\uff0c\u53ef\u7528\u4e8e\u5907\u4efd\u548c\u8fd8\u539f\u529f\u80fd\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u7ba1\u7406\u5206\u5e03\u5f0f\u96c6\u7fa4\u4e2d\u7684\u7f13\u5b58\u3002\n <\/div>\n

\u6570\u636e\u5e93\u7f13\u5b58<\/h3>\n
\n \u6570\u636e\u5e93\u7f13\u5b58\u662f\u4e00\u79cd\u901a\u8fc7\u83b7\u53d6\u6570\u636e\u6309\u9700(\u52a8\u6001)\u751f\u6210\u7f51\u9875\u7684\u673a\u5236\u3002\u4ece\u6570\u636e\u5e93\u4e2d\u3002\u5b83\u5728\u6d89\u53ca\u5ba2\u6237\u7aef\uff0cWeb\u5e94\u7528\u7a0b\u5e8f\u670d\u52a1\u5668\u548c\u6570\u636e\u5e93\u7684
\n \u591a\u5c42<\/strong>\u73af\u5883\u4e2d\u4f7f\u7528\u3002\u901a\u8fc7\u5206\u914d\u67e5\u8be2\u5de5\u4f5c\u8d1f\u8f7d\uff0c\u5b83\u63d0\u9ad8\u4e86
\n \u53ef\u6269\u5c55\u6027<\/strong>\u548c
\n \u6027\u80fd<\/strong>\u3002\u6700\u53d7\u6b22\u8fce\u7684\u6570\u636e\u5e93\u7f13\u5b58\u662f Hibernate \u7684\u4e00\u7ea7\u7f13\u5b58\u3002\n <\/div>\n

Web\u670d\u52a1\u5668\u7f13\u5b58<\/h3>\n
\n Web\u670d\u52a1\u5668\u7f13\u5b58\u662f\u4e00\u79cd\u5b58\u50a8\u6570\u636e\u4ee5\u4fbf
\n \u91cd\u7528<\/strong>\u7684\u673a\u5236\u3002\u4f8b\u5982\uff0c\u7531Web\u670d\u52a1\u5668\u63d0\u4f9b\u7684\u7f51\u9875\u7684\u526f\u672c\u3002\u7528\u6237\u9996\u6b21\u8bbf\u95ee\u8be5\u9875\u9762\u65f6\u5c06\u5bf9\u5176\u8fdb\u884c\u7f13\u5b58\u3002\u5982\u679c\u7528\u6237\u4e0b\u6b21\u518d\u6b21\u8bf7\u6c42\u76f8\u540c\u7684\u5185\u5bb9\uff0c\u5219\u7f13\u5b58\u5c06\u63d0\u4f9b\u9875\u9762\u7684\u526f\u672c\u3002\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u670d\u52a1\u5668\u8868\u5355\u8fc7\u8f7d\u3002 Web\u670d\u52a1\u5668\u7f13\u5b58\u53ef\u63d0\u9ad8\u9875\u9762\u4ea4\u4ed8\u901f\u5ea6\uff0c\u5e76\u51cf\u5c11\u540e\u7aef\u670d\u52a1\u5668\u8981\u505a\u7684\u5de5\u4f5c\u3002\n <\/div>\n

CDN\u7f13\u5b58<\/h3>\n
\n CDN <\/strong>\u4ee3\u8868
\n \u5185\u5bb9\u4ea4\u4ed8\u7f51\u7edc<\/strong>\u3002\u5b83\u662f\u73b0\u4ee3Web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u7684\u7ec4\u4ef6\u3002\u901a\u8fc7
\n \u590d\u5236<\/strong>\u5e38\u7528\u6587\u4ef6(\u4f8b\u5982 HTML \u9875\u9762\uff0c\u6837\u5f0f\u8868)\uff0c\u5b83\u53ef\u4ee5\u6539\u5584\u5185\u5bb9\u7684\u4f20\u9012\u3002 \uff0c JavaScript \uff0c\u56fe\u50cf\uff0c\u89c6\u9891\u7b49)\u5206\u5e03\u5728\u4e00\u7ec4\u5168\u7403\u5206\u5e03\u7684
\n \u7f13\u5b58\u670d\u52a1\u5668\u4e0a\u3002<\/strong>\n <\/div>\n
\n \u8fd9\u662fCDN\u8d8a\u6765\u8d8a\u53d7\u6b22\u8fce\u7684\u539f\u56e0\u3002 CDN\u51cf\u8f7b\u4e86\u5e94\u7528\u7a0b\u5e8f\u6e90\u7684\u8d1f\u62c5\uff0c\u5e76\u6539\u5584\u4e86\u7528\u6237\u4f53\u9a8c\u3002\u5b83\u4ece\u9644\u8fd1\u7684
\n \u7f13\u5b58\u8fb9\u7f18<\/strong>(\u66f4\u9760\u8fd1\u6700\u7ec8\u7528\u6237\u7684\u7f13\u5b58\u670d\u52a1\u5668)\u6216
\n \u5b58\u5728\u70b9(PoP)<\/strong>\u63d0\u4f9b\u5185\u5bb9\u7684\u672c\u5730\u526f\u672c\u3002\n <\/div>\n

\u7f13\u5b58\u4e0e\u7f13\u51b2\u533a<\/h2>\n\n\n\n\n\n\n\n\n\n
\u7f13\u5b58<\/td>\n\u7f13\u51b2\u533a<\/td>\n<\/tr>\n
\u7f13\u5b58\u57fa\u4e8e\u6700\u8fd1\u6700\u5c11\u4f7f\u7528<\/strong>\u3002<\/td>\n\u7f13\u51b2\u533a\u57fa\u4e8e\u5148\u8fdb\u5148\u51fa<\/strong> <\/td>\n<\/tr>\n
\u5b83\u662f\u9875\u9762\u7f13\u5b58\u7684\u5927\u5c0f\u3002<\/td>\n\u5b83\u662f\u5185\u5b58\u4e2d\u7684\u539f\u59cb\u5757I\/O\u7f13\u51b2\u533a\u3002<\/td>\n<\/tr>\n
\u5b83\u751f\u5b58\u4e86\u5f88\u957f<\/strong>\u65f6\u671f\u3002<\/td>\n\u5b83\u751f\u5b58\u4e86\u77ed<\/strong>\u65f6\u671f\u3002<\/td>\n<\/tr>\n
\u6211\u4eec\u4ece\u7f13\u5b58\u4e2d\u8bfb\u53d6<\/strong>\u3002<\/td>\n\u6211\u4eec\u5199\u5165<\/strong>\u5230\u7f13\u51b2\u533a\u3002<\/td>\n<\/tr>\n
\u5b83\u5b58\u50a8\u5b9e\u9645<\/strong>\u6587\u4ef6\u6570\u636e\u3002<\/td>\n\u5b83\u5b58\u50a8\u6587\u4ef6\u5143\u6570\u636e<\/strong>\u3002<\/td>\n<\/tr>\n
\u5b83\u63d0\u9ad8\u4e86 read <\/strong>\u6027\u80fd\u3002<\/td>\n\u5b83\u63d0\u9ad8\u4e86\u5199\u5165<\/strong>\u6027\u80fd\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Spring Boot\u7f13\u5b58\u6ce8\u89e3<\/h2>\n

@EnableCaching <\/h3>\n
\n \u8fd9\u662f\u4e00\u4e2a\u7c7b\u7ea7\u522b\u7684\u6ce8\u89e3\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528
\n @EnableCaching\u6ce8\u89e3\u5728Spring Boot\u5e94\u7528\u7a0b\u5e8f\u4e2d\u542f\u7528\u7f13\u5b58\u3002<\/strong>\u5b83\u5728
\n org.springframework.cache.annotation <\/strong>\u5305\u4e2d\u5b9a\u4e49\u3002\u5b83\u4e0e
\n @Configuration <\/strong>\u7c7b\u4e00\u8d77\u4f7f\u7528\u3002\n <\/div>\n
\n \u5982\u679c\u6ca1\u6709\u5df2\u5b9a\u4e49\u7684CacheManager\u5b9e\u4f8b\uff0c\u81ea\u52a8\u914d\u7f6e\u5c06\u542f\u7528\u7f13\u5b58\u5e76\u8bbe\u7f6e
\n CacheManager <\/strong>\u3002\u5b83\u4f1a\u626b\u63cf\u7279\u5b9a\u7684\u63d0\u4f9b\u7a0b\u5e8f\uff0c\u5982\u679c\u627e\u4e0d\u5230\uff0c\u5219\u4f1a\u4f7f\u7528\u5e76\u53d1\u7684
\n HashMap\u521b\u5efa\u5185\u5b58\u4e2d\u7f13\u5b58\u3002<\/strong>\n <\/div>\n
\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u5728\u4ee5\u4e0b\u793a\u4f8b\u4e2d\uff0c
\n @EnableCaching <\/strong>\u6ce8\u89e3\u542f\u7528\u4e86\u7f13\u5b58\u673a\u5236\u3002\n <\/div>\n
\n
\r\n@SpringBootApplication\r\n@EnableCaching \r\npublic <\/span>class <\/span>SpringBootCachingApplication \r\n{\r\npublic <\/span>static void <\/span>main(String[] args) \r\n{\r\nSpringApplication.run<\/span>(SpringBootCachingApplication.class, args);\r\n}\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

@CacheConfig <\/h3>\n
\n \u8fd9\u662f\u4e00\u4e2a\u7c7b\u7ea7\u522b\u7684\u6ce8\u89e3\uff0c\u63d0\u4f9b\u4e86\u4e0e\u7f13\u5b58\u6709\u5173\u7684\u901a\u7528\u8bbe\u7f6e\u3002\u5b83\u544a\u8bc9Spring\u5c06\u7c7b\u7684\u7f13\u5b58\u5b58\u50a8\u5728\u4f55\u5904\u3002\u5f53\u6211\u4eec\u4f7f\u7528\u6ce8\u89e3\u4e3a\u7c7b\u6dfb\u52a0\u6ce8\u89e3\u65f6\uff0c\u5b83\u4e3a\u8be5\u7c7b\u4e2d\u5b9a\u4e49\u7684\u4efb\u4f55\u7f13\u5b58\u64cd\u4f5c\u63d0\u4f9b\u4e86\u4e00\u7ec4\u9ed8\u8ba4\u8bbe\u7f6e\u3002\u4f7f\u7528\u6ce8\u89e3\uff0c\u6211\u4eec\u4e0d\u9700\u8981\u591a\u6b21\u58f0\u660e\u3002\n <\/div>\n
\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c
\n \u5458\u5de5<\/strong>\u662f\u7f13\u5b58\u7684\u540d\u79f0\u3002\n <\/div>\n
\n
\r\n@CacheConfig(cacheNames={\"employee\"<\/span>}) \r\npublic <\/span>class <\/span>UserService\r\n{\r\n\/\/some code\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

@Caching<\/h3>\n
\n \u5f53\u6211\u4eec\u540c\u65f6\u9700\u8981\u4e24\u4e2a\u6ce8\u89e3
\n @CachePut <\/strong>\u6216
\n @CacheEvict <\/strong>\u65f6\u4f7f\u7528\u540c\u6837\u7684\u65b9\u6cd5\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5f53\u6211\u4eec\u8981\u4f7f\u7528\u76f8\u540c\u7c7b\u578b\u7684\u591a\u4e2a\u6ce8\u89e3\u65f6\u4f7f\u7528\u3002\n <\/div>\n
\n \u4f46\u662f
\n Java\u4e0d\u5141\u8bb8\u4e3a\u7ed9\u5b9a\u58f0\u660e\u76f8\u540c\u7c7b\u578b\u7684\u591a\u4e2a\u6ce8\u89e3<\/strong>\u65b9\u6cd5\u3002\u4e3a\u907f\u514d\u6b64\u95ee\u9898\uff0c\u6211\u4eec\u4f7f\u7528
\n @Caching <\/strong>\u6ce8\u89e3\u3002\n <\/div>\n
\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e86\u6ce8\u89e3
\n @Caching <\/strong>\u5e76\u5c06\u6240\u6709
\n @CacheEvict <\/strong>\u6ce8\u89e3\u5206\u7ec4\u3002\n <\/div>\n
\n
\r\n@Caching(evict = {@CacheEvict(\"phone_number\"<\/span>), @CacheEvict(value=\"directory\"<\/span>, key=\"#student.id\"<\/span>) })<\/span>\r\npublic <\/span>String getAddress(Student student) \r\n{\r\n\/\/some code\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

@Cacheable <\/h3>\n
\n \u5b83\u662f\u65b9\u6cd5\u7ea7\u522b\u7684\u6ce8\u89e3\u3002\u5b83\u4e3a\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7f13\u5b58\u3002 Spring\u6846\u67b6\u7ba1\u7406\u65b9\u6cd5\u5bf9\u6ce8\u89e3\u5c5e\u6027\u4e2d\u6307\u5b9a\u7684\u7f13\u5b58\u7684\u8bf7\u6c42\u548c\u54cd\u5e94\u3002 @Cacheable\u6279\u6ce8\u5305\u542b\u66f4\u591a\u9009\u9879\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528
\n value <\/strong>\u6216
\n cacheNames <\/strong>\u5c5e\u6027\u63d0\u4f9b
\n \u7f13\u5b58\u540d\u79f0<\/strong>\u3002\n <\/div>\n
\n \u6211\u4eec\u8fd8\u53ef\u4ee5\u6307\u5b9a\u6ce8\u89e3\u7684
\n key <\/strong>\u5c5e\u6027\uff0c\u7528\u4e8e\u552f\u4e00\u6807\u8bc6\u7f13\u5b58\u4e2d\u7684\u6bcf\u4e2a\u6761\u76ee\u3002\u5982\u679c\u672a\u6307\u5b9a\u5bc6\u94a5\uff0cSpring\u5c06\u4f7f\u7528\u9ed8\u8ba4\u673a\u5236\u6765\u521b\u5efa\u5bc6\u94a5\u3002\n <\/div>\n
\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u5728\u4ee5\u4e0b\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u7f13\u5b58\u4e86<
\n cacheStudentInfo\uff0c<\/strong>\u548c
\n id <\/strong>\u4e2d\u65b9\u6cd5
\n studentInfo()<\/strong>\u7684strong>\u8fd4\u56de\u503c\u662f\u552f\u4e00\u952e\uff0c\u7528\u4e8e\u6807\u8bc6\u7f13\u5b58\u3002\n <\/div>\n
\n
\r\n@Cacheable(value=\"cacheStudentInfo\"<\/span>, key=\"#id\"<\/span>)<\/span>\r\npublic <\/span>List studentInfo()\r\n{\r\n\/\/some code \r\nreturn <\/span>studentDetails;\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u6211\u4eec\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528condition\u5c5e\u6027\u5728\u6ce8\u89e3\u4e2d\u5e94\u7528\u6761\u4ef6\u3002\u5f53\u6211\u4eec\u5728\u6ce8\u89e3\u4e2d\u5e94\u7528\u6761\u4ef6\u65f6\uff0c\u5b83\u79f0\u4e3a
\n \u6761\u4ef6\u7f13\u5b58<\/strong>\u3002\n <\/div>\n
\n \u4f8b\u5982\uff0c\u5982\u679c\u53c2\u6570\u540d\u79f0\u7684\u957f\u5ea6\u77ed\u4e8e20\uff0c\u5219\u5c06\u7f13\u5b58\u4ee5\u4e0b\u65b9\u6cd5\u3002\n <\/div>\n
\n
\r\n@Cacheable(value=\"student\"<\/span>, condition=\"#name.length<20\"<\/span>)<\/span>\r\npublic <\/span>Student findStudent(String name)\r\n{\r\n\/\/some code\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

@CacheEvict <\/h3>\n
\n \u5b83\u662f\u65b9\u6cd5\u7ea7\u522b\u7684\u6ce8\u89e3\u3002\u5f53\u6211\u4eec\u60f3\u8981\u4ece\u7f13\u5b58\u4e2d\u5220\u9664\u9648\u65e7\u6216\u672a\u4f7f\u7528\u7684\u6570\u636e\u65f6\uff0c\u5c06\u4f7f\u7528\u5b83\u3002\u5b83\u9700\u8981\u4e00\u4e2a\u6216\u591a\u4e2a\u53d7\u64cd\u4f5c\u5f71\u54cd\u7684\u7f13\u5b58\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u5728\u5176\u4e2d\u6307\u5b9a\u952e\u6216\u6761\u4ef6\u3002\u5982\u679c\u6211\u4eec\u60f3\u8981\u5e7f\u6cdb\u7684\u7f13\u5b58\u9a71\u9010\uff0c\u5219@CacheEvict\u6279\u6ce8\u63d0\u4f9b\u4e00\u4e2a\u540d\u4e3a
\n allEntries <\/strong>\u7684\u53c2\u6570\u3002\u5b83\u4f1a\u9a71\u9010\u6240\u6709\u6761\u76ee\uff0c\u800c\u4e0d\u662f\u6839\u636e\u5bc6\u94a5\u9a71\u9010\u4e00\u4e2a\u6761\u76ee\u3002\n <\/div>\n
\n \u5173\u4e8e@CacheEvict\u6279\u6ce8\u7684\u91cd\u8981\u4e00\u70b9\u662f\u5b83\u53ef\u4ee5\u4e0evoid\u65b9\u6cd5\u4e00\u8d77\u4f7f\u7528\uff0c\u56e0\u4e3a\u8be5\u65b9\u6cd5\u5145\u5f53\u89e6\u53d1\u5668\u3002\u5b83\u907f\u514d\u4e86\u8fd4\u56de\u503c\u3002\u53e6\u4e00\u65b9\u9762\uff0c@Cacheable\u6279\u6ce8\u9700\u8981\u4e00\u4e2a\u8fd4\u56de\u503c\uff0c\u8be5\u503c\u7528\u4e8e\u6dfb\u52a0\/\u66f4\u65b0\u7f13\u5b58\u4e2d\u7684\u6570\u636e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u4f7f\u7528@CacheEvict\u6279\u6ce8:\n <\/div>\n
\n \u9010\u51fa\u6574\u4e2a\u7f13\u5b58:\n <\/div>\n
\n
\r\n@CacheEvict(allEntries=true)\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u901a\u8fc7\u5bc6\u94a5\u9010\u51fa\u6761\u76ee:\n <\/div>\n
\n
\r\n@CacheEvict(key=\"#student.stud_name\"<\/span>)<\/span>\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u4ee5\u4e0b\u5e26\u6ce8\u89e3\u7684\u65b9\u6cd5\u4ece\u7f13\u5b58
\n student_data <\/strong>\u4e2d\u6e05\u9664\u6240\u6709\u6570\u636e\u3002\n <\/div>\n
\n
\r\n@CacheEvict(value=\"student_data\"<\/span>, allEntries=true) \/\/removing all entries from the cache\r\npublic <\/span>String getNames(Student student) \r\n{\r\n\/\/some code\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

@CachePut <\/h3>\n
\n \u5b83\u662f\u65b9\u6cd5\u7ea7\u522b\u7684\u6ce8\u89e3\u3002\u5f53\u6211\u4eec\u60f3\u8981
\n \u66f4\u65b0<\/strong>\u7f13\u5b58\u800c\u4e0d\u5e72\u6270\u65b9\u6cd5\u6267\u884c\u65f6\uff0c\u4f7f\u7528\u5b83\u3002\u8fd9\u610f\u5473\u7740\u8be5\u65b9\u6cd5\u5c06\u59cb\u7ec8\u6267\u884c\uff0c\u5e76\u5c06\u5176\u7ed3\u679c\u653e\u5165\u7f13\u5b58\u4e2d\u3002\u5b83\u652f\u6301@Cacheable\u6279\u6ce8\u7684\u5c5e\u6027\u3002\n <\/div>\n
\n \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8e@Cacheable\u548c@CachePut\u6279\u6ce8\u7684\u884c\u4e3a\u4e0d\u540c\uff0c\u56e0\u6b64\u5b83\u4eec\u662f\u4e0d\u76f8\u540c\u7684\u3002 @Cacheable\u548c@CachePut\u6279\u6ce8\u4e4b\u95f4\u5b58\u5728\u7ec6\u5fae\u5dee\u522b\uff0c\u5c31\u662f@
\n Cacheable <\/strong>\u6279\u6ce8
\n \u8df3\u8fc7\u65b9\u6cd5\u6267\u884c<\/strong>\uff0c\u800c
\n @CachePut <\/strong>\u6279\u6ce8
\n \u8fd0\u884c\u8be5\u65b9\u6cd5<\/strong>\uff0c\u7136\u540e\u5c06\u7ed3\u679c\u653e\u5165\u7f13\u5b58\u3002\n <\/div>\n
\n \u793a\u4f8b<\/strong>\n <\/div>\n
\n \u4ee5\u4e0b\u65b9\u6cd5\u5c06\u66f4\u65b0\u7f13\u5b58\u672c\u8eab\u3002\n <\/div>\n
\n
\r\n@CachePut(cacheNames=\"employee\"<\/span>, key=\"#id\"<\/span>)  \/\/updating cache<\/span>\r\npublic <\/span>Employee updateEmp(ID id, EmployeeData data)\r\n{\r\n\/\/some code\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

Spring Boot\u7f13\u5b58\u4f9d\u8d56\u9879<\/h2>\n
\n \u5982\u679c\u8981\u5728Spring Boot\u5e94\u7528\u7a0b\u5e8f\u4e2d\u542f\u7528\u7f13\u5b58\u673a\u5236\uff0c\u5219\u9700\u8981\u5728pom.xml\u6587\u4ef6\u4e2d\u6dfb\u52a0\u7f13\u5b58\u4f9d\u8d56\u9879\u3002\u5b83\u542f\u7528\u7f13\u5b58\u5e76\u914d\u7f6eCacheManager\u3002\n <\/div>\n
\n
\r\n<dependency>\r\n<groupId>org.springframework.boot<\/groupId>\r\n<artifactId>spring-boot-starter-cache<\/artifactId>\r\n<\/dependency> \r\n<\/pre>\n

<\/code>\n <\/div>\n

Spring Boot\u7f13\u5b58\u793a\u4f8b<\/h2>\n
\n \u6211\u4eec\u521b\u5efa\u4e00\u4e2aSpring Boot\u5e94\u7528\u7a0b\u5e8f\u5e76\u5728\u5176\u4e2d\u5b9e\u73b0\u7f13\u5b58\u673a\u5236\u3002\n <\/div>\n
\n \u6b65\u9aa41: <\/strong>\u6253\u5f00Spring Initializr http:\/\/start.spring.io \u3002\n <\/div>\n
\n \u6b65\u9aa42: <\/strong>\u9009\u62e9Spring Boot\u7248\u672c
\n 2.3.0.M1\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa42: <\/strong>\u63d0\u4f9b
\n \u7fa4\u7ec4<\/strong>\u540d\u79f0\u3002\u6211\u4eec\u63d0\u4f9b\u4e86
\n com.lidihuo\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa43: <\/strong>\u63d0\u4f9b
\n \u5de5\u4ef6<\/strong> ID\u3002\u6211\u4eec\u63d0\u4f9b\u4e86
\n spring-boot-cache-example\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa45: <\/strong>\u6dfb\u52a0\u4f9d\u8d56\u9879
\n Spring Web <\/strong>\u548c
\n Spring Cache\u62bd\u8c61\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa46: <\/strong>\u5355\u51fb
\n Generate <\/strong>(\u751f\u6210)\u6309\u94ae\u3002\u5f53\u6211\u4eec\u5355\u51fb\"\u751f\u6210\"\u6309\u94ae\u65f6\uff0c\u5b83\u5c06\u89c4\u683c\u5305\u88c5\u5728
\n Jar <\/strong>\u6587\u4ef6\u4e2d\uff0c\u5e76\u5c06\u5176\u4e0b\u8f7d\u5230\u672c\u5730\u7cfb\u7edf\u3002\n <\/div>\n
\n \u6b65\u9aa47: <\/strong>
\n \u63d0\u53d6<\/strong> Jar\u6587\u4ef6\u5e76\u5c06\u5176\u7c98\u8d34\u5230STS\u5de5\u4f5c\u533a\u4e2d\u3002\n <\/div>\n
\n \u6b65\u9aa48: <\/strong>
\n \u5bfc\u5165<\/strong> STS\u4e2d\u7684\u9879\u76ee\u6587\u4ef6\u5939\u3002\n <\/div>\n
\n \u6587\u4ef6->\u5bfc\u5165->\u73b0\u6709Maven\u9879\u76ee->\u6d4f\u89c8->\u9009\u62e9\u6587\u4ef6\u5939spring-boot-cache-example->\u5b8c\u6210\n <\/div>\n
\n \u5bfc\u5165\u9700\u8981\u4e00\u4e9b\u65f6\u95f4\u3002\n <\/div>\n
\n \u8ba9\u6211\u4eec\u6253\u5f00
\n pom.xml <\/strong>\u6587\u4ef6\uff0c\u770b\u770b\u6211\u4eec\u5df2\u7ecf\u5411\u5176\u4e2d\u6dfb\u52a0\u4e86\u54ea\u4e9b\u4f9d\u8d56\u9879\u3002\n <\/div>\n
\n pom.xml <\/strong>\n <\/div>\n
\n
\r\n<?xml version=\"1.0\"<\/span> encoding=\"UTF-8\"<\/span>?>\r\n<project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"<\/span> xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span>\r\n  xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"<\/span>>\r\n  <modelVersion>4.0.0<\/modelVersion>\r\n  <parent>\r\n    <groupId>org.springframework.boot<\/groupId>\r\n    <artifactId>spring-boot-starter-parent<\/artifactId>\r\n    <version>2.3.0.M1<\/version>\r\n    <relativePath\/> <!-- lookup parent from repository -->\r\n  <\/parent>\r\n  <groupId>com.lidihuo<\/groupId>\r\n  <artifactId>spring-boot-cache-example<\/artifactId>\r\n  <version>0.0.1-SNAPSHOT<\/version>\r\n  <name>spring-boot-cache-example<\/name>\r\n  <description>Demo project for <\/span>Spring Boot<\/description>\r\n  <properties>\r\n    <java.version>1.8<\/java.version>\r\n  <\/properties>\r\n  <dependencies>\r\n    <dependency>\r\n      <groupId>org.springframework.boot<\/groupId>\r\n      <artifactId>spring-boot-starter-cache<\/artifactId>\r\n    <\/dependency>\r\n    <dependency>\r\n      <groupId>org.springframework.boot<\/groupId>\r\n      <artifactId>spring-boot-starter-web<\/artifactId>\r\n    <\/dependency>\r\n    <dependency>\r\n      <groupId>org.springframework.boot<\/groupId>\r\n      <artifactId>spring-boot-starter-test<\/artifactId>\r\n      <scope>test<\/scope>\r\n      <exclusions>\r\n        <exclusion>\r\n          <groupId>org.junit.vintage<\/groupId>\r\n          <artifactId>junit-vintage-engine<\/artifactId>\r\n        <\/exclusion>\r\n      <\/exclusions>\r\n    <\/dependency>\r\n  <\/dependencies>\r\n  <build>\r\n    <plugins>\r\n      <plugin>\r\n        <groupId>org.springframework.boot<\/groupId>\r\n        <artifactId>spring-boot-maven-plugin<\/artifactId>\r\n      <\/plugin>\r\n    <\/plugins>\r\n  <\/build>\r\n  <repositories>\r\n    <repository>\r\n      <id>spring-milestones<\/id>\r\n      <name>Spring Milestones<\/name>\r\n      <url>https:\/\/repo.spring.io\/milestone<\/url>\r\n    <\/repository>\r\n  <\/repositories>\r\n  <pluginRepositories>\r\n    <pluginRepository>\r\n      <id>spring-milestones<\/id>\r\n      <name>Spring Milestones<\/name>\r\n      <url>https:\/\/repo.spring.io\/milestone<\/url>\r\n    <\/pluginRepository>\r\n  <\/pluginRepositories>\r\n<\/project>\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u6b65\u9aa49: <\/strong>\u6253\u5f00
\n SpringBootCacheExampleApplication.java <\/strong>\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7\u6dfb\u52a0\u6ce8\u89e3
\n @EnableCaching\u542f\u7528\u7f13\u5b58\u3002<\/strong>\n <\/div>\n
\n
\r\nSpringBootCacheExampleApplication.java\r\npackage <\/span>com.lidihuo;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.cache.annotation.EnableCaching;\r\n@SpringBootApplication\r\n\/\/enabling caching\r\n@EnableCaching\r\npublic <\/span>class <\/span>SpringBootCacheExampleApplication \r\n{\r\npublic <\/span>static void <\/span>main(String[] args) \r\n{\r\nSpringApplication.run<\/span>(SpringBootCacheExampleApplication.class, args);\r\n}\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u6b65\u9aa410: <\/strong>\u5728\u540d\u4e3a
\n com.lidihuo.model\u7684\u6587\u4ef6\u5939 src\/main\/java <\/strong>\u4e2d\u521b\u5efa\u4e00\u4e2a\u5305\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa411: <\/strong>\u5728\u6a21\u578b\u5305\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\u4e3a
\n Customer <\/strong>\u7684\u7c7b\u5e76\u5b9a\u4e49\u4ee5\u4e0b\u5185\u5bb9:\n <\/div>\n

\u5b9a\u4e49\u4e09\u4e2aaccountno, customername, acounttype<\/strong>\u548cbalance<\/strong>\u3002<\/span>
\n \u4f7f\u7528Constructor\u751f\u6210\u6784\u9020\u5668<\/strong> \u3002
\u53f3\u952e\u5355\u51fb\u6587\u4ef6->\u6e90->\u4f7f\u7528\u5b57\u6bb5\u751f\u6210\u6784\u9020\u5668->\u5168\u9009->\u751f\u6210<\/span>
\n \u751f\u6210Getters and Setters\u3002<\/strong>
\u53f3\u952e\u5355\u51fb\u6587\u4ef6->\u6e90->\u751f\u6210Getter\u548c\u8bbe\u7f6e\u5668->\u5168\u9009->\u751f\u6210<\/span> <\/p>\n

\n Customer.java <\/strong>\n <\/div>\n
\n
\r\npackage <\/span>com.lidihuo.model;\r\npublic <\/span>class <\/span>Customer \r\n{\r\nprivate <\/span>int <\/span>accountno;\r\nprivate <\/span>String customername;\r\nprivate <\/span>String accounttype;\r\nprivate double <\/span>balance;\r\npublic <\/span>Customer(int <\/span>accountno, String customername, String accounttype, double <\/span>balance) \r\n{\r\nthis<\/span>.accountno = accountno;\r\nthis<\/span>.customername = customername;\r\nthis<\/span>.accounttype = accounttype;\r\nthis<\/span>.balance = balance;\r\n}\r\npublic <\/span>int <\/span>getAccountno() \r\n{\r\nreturn <\/span>accountno;\r\n}\r\npublic void <\/span>setAccountno(int <\/span>accountno) \r\n{\r\nthis<\/span>.accountno = accountno;\r\n}\r\npublic <\/span>String getCustomername() \r\n{\r\nreturn <\/span>customername;\r\n}\r\npublic void <\/span>setCustomername(String customername) \r\n{\r\nthis<\/span>.customername = customername;\r\n}\r\npublic <\/span>String getAccounttype() \r\n{\r\nreturn <\/span>accounttype;\r\n}\r\npublic void <\/span>setAccounttype(String accounttype) \r\n{\r\nthis<\/span>.accounttype = accounttype;\r\n}\r\npublic double <\/span>getBalance() \r\n{\r\nreturn <\/span>balance;\r\n}\r\npublic void <\/span>setBalance(double balance) \r\n{\r\nthis<\/span>.balance = balance;\r\n}\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u6b65\u9aa411: <\/strong>\u5728\u6587\u4ef6\u5939
\n src\/main\/java <\/strong>\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\u4e3a
\n com.lidihuo.controller\u7684\u5305\u3002<\/strong>\n <\/div>\n
\n \u6b65\u9aa412: <\/strong>\u5728Controller\u7a0b\u5e8f\u5305\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\u4e3a
\n CustomerController <\/strong>\u7684\u63a7\u5236\u5668\u7c7b\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c:\n <\/div>\n

\u4f7f\u7528\u6ce8\u89e3 @RestController\u5c06\u7c7b\u6807\u8bb0\u4e3a Controller <\/strong>\u3002<\/strong> <\/span>
\n \u4f7f\u7528\u6ce8\u89e3 @RequestMapping\u4e3a\u63a7\u5236\u5668\u5b9a\u4e49\u6620\u5c04<\/strong>\u3002<\/strong>\u6211\u4eec\u5df2\u7ecf\u5b9a\u4e49\u4e86\u6620\u5c04\/customerinfo <\/strong>\u3002<\/span>
\n \u521b\u5efa\u7f13\u5b58<\/strong>\u4ee5\u4f7f\u7528\u6ce8\u89e3 @Cacheable\u83b7\u53d6\u6570\u636e\u3002 <\/strong>\u6211\u4eec\u5df2\u7ecf\u901a\u8fc7\u4f7f\u7528\u6ce8\u89e3\u7684 value <\/strong>\u5c5e\u6027\u5b9a\u4e49\u4e86\u7f13\u5b58\u540d\u79f0\u3002<\/span>
\n \u6211\u4eec\u5728<\/span>\u4e2d\u6dfb\u52a0\u4e86\u4e24\u4e2a\u5ba2\u6237\u8be6\u7ec6\u4fe1\u606f <\/p>\n

\n CustomerController.java <\/strong>\n <\/div>\n
\n
\r\npackage <\/span>com.lidihuo.controller;\r\nimport java.util.Arrays;\r\nimport java.util.List;\r\nimport org.springframework.cache.annotation.Cacheable;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RestController;\r\nimport com.lidihuo.model.Customer;\r\n@RestController\r\npublic <\/span>class <\/span>CustomerController \r\n{\r\n@RequestMapping(\"\/customerinfo\"<\/span>)\r\n\/\/defines a cache for <\/span>method's return <\/span>value\r\n@Cacheable(value=\"customerInfo\"<\/span>)\r\npublic <\/span>List customerInformation()\r\n{\r\nSystem.out.println<\/span>(\"customer information from cache\"<\/span>);\r\n\/\/adding customer detail in the List\r\n  List detail=Arrays.asList<\/span>(new Customer(5126890,\"Charlie Puth\"<\/span>,\"Current A\/c\"<\/span>, 450000.00),\r\n                new <\/span>Customer(7620015,\"Andrew Flintoff\"<\/span>,\"Saving A\/c\"<\/span>, 210089.00)\r\n               );\r\nreturn <\/span>detail;\r\n}\r\n}\r\n<\/pre>\n

<\/code>\n <\/div>\n

\n \u73b0\u5728\u8fd0\u884c\u8be5\u5e94\u7528\u7a0b\u5e8f\u3002\n <\/div>\n
\n \u6b65\u9aa413: <\/strong>\u6253\u5f00
\n SpringBootCacheExampleApplication.java <\/strong>\u6587\u4ef6\u5e76\u5c06\u5176\u4f5c\u4e3aJava\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u3002\n <\/div>\n
\n \u6b65\u9aa414: <\/strong>\u6253\u5f00
\n Postman<\/strong>\uff0c\u5e76\u53d1\u9001\u5e26\u6709URL http: \/\/locahost: 8080\/custmerinfo\u7684
\n GET <\/strong>\u8bf7\u6c42\u3002\u5b83\u8fd4\u56de\u5ba2\u6237\u8be6\u7ec6\u4fe1\u606f\uff0c\u5982\u4e0b\u6240\u793a\u3002\n <\/div>\n

Spring Boot\u7f13\u5b58_https:\/\/bianchenghao6.com_\u3010SpringBoot \u6559\u7a0b\u3011_\u7b2c1\u5f20
\n <\/p>\n


\n
\n SpringBoot \u7f13\u5b58\u63d0\u4f9b\u7a0b\u5e8f
\n SpringBoot EhCaching\n <\/div>\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"Spring Boot\u7f13\u5b58zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-593","post","type-post","status-publish","format-standard","hentry","category-bc_springboot_jc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/593"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=593"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/593\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}