{"id":2361,"date":"2023-06-27T15:33:04","date_gmt":"2023-06-27T07:33:04","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=2361"},"modified":"2023-06-27T15:33:04","modified_gmt":"2023-06-27T07:33:04","slug":"springboot%e9%9b%86%e6%88%90redis%e9%87%87%e7%94%a8%e5%88%86%e5%b8%83%e5%bc%8f%e9%94%81%e5%ae%9e%e7%8e%b0%e6%8e%a5%e5%8f%a3%e9%99%90%e6%b5%81","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/springboot%e9%9b%86%e6%88%90redis%e9%87%87%e7%94%a8%e5%88%86%e5%b8%83%e5%bc%8f%e9%94%81%e5%ae%9e%e7%8e%b0%e6%8e%a5%e5%8f%a3%e9%99%90%e6%b5%81\/","title":{"rendered":"springboot\u96c6\u6210redis\u91c7\u7528\u5206\u5e03\u5f0f\u9501\u5b9e\u73b0\u63a5\u53e3\u9650\u6d41"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;padding: 0px 10px;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;overflow-wrap: break-word;text-align: left;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\">\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0 0 20px;padding: 0;line-height: 1.8em;color: #3a3a3a;\"><br  \/><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 16px;padding-top: 8px;padding-bottom: 8px;margin: 0 0 20px;padding: 0;line-height: 1.8em;color: #3a3a3a;\">\u5927\u5bb6\u597d\uff0c\u6211\u662f\u4e00\u5b89\uff0c\u4eca\u5929\u804a\u4e00\u4e0b\u5728\u4e0d\u96c6\u6210springcloud\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u4f55\u5229\u7528springboot+redis\uff0c\u5b9e\u73b0\u63a5\u53e3\u9650\u6d41\uff08\u9632\u6b62\u6076\u610f\u5237\u65b0\u6216\u66b4\u529b\u8bf7\u6c42\uff09\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 20px;line-height: 1.4;padding-top: 10px;margin: 10px 0 5px;\"><span style=\"display: none;\"><\/span><span style=\"color: #515151;font-weight: 700;font-size: 1.0em;padding-left: 20px;border-left: 3px solid #f9bf45;\">\u9650\u6d41\u8fd8\u6709\u5176\u4ed6\u65b9\u5f0f\uff0c\u6bd4\u5982\uff1a<\/span><span style=\"display: none;\"><\/span><\/h3>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"line-height: 1.5em;margin-top: 30px;margin-bottom: 15px;padding: 0px;font-weight: bold;color: black;font-size: 18px;\"><span style=\"display: none;\"><\/span>\u57fa\u4e8e\u81ea\u5b9a\u4e49\u6ce8\u89e3+RateLimiter\u5b9e\u73b0<\/h4>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background: url(&quot;https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152142204.jpeg&quot;) 10px 10px \/ 40px no-repeat rgb(40, 44, 52);height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;\"><\/span><code style=\"overflow-x: auto;padding: 16px;color: #abb2bf;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;padding-top: 15px;background: #282c34;border-radius: 5px;\">@Configuration<br  \/>public&nbsp;class&nbsp;WebConfig&nbsp;implements&nbsp;WebMvcConfigurer&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;@Autowired<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;LimitInterceptor&nbsp;limitInterceptor;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;@Override<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;void&nbsp;addInterceptors(InterceptorRegistry&nbsp;registry)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;registry.addInterceptor(limitInterceptor)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u62e6\u622a\u6240\u6709\u8bf7\u6c42\u8def\u5f84<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.addPathPatterns(<span style=\"color: #98c379;line-height: 26px;\">\"\/**\"<\/span>)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/\u518d\u8bbe\u7f6e&nbsp;\u653e\u5f00\u54ea\u4e9b\u8def\u5f84<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.excludePathPatterns(<span style=\"color: #98c379;line-height: 26px;\">\"\/static\/**\"<\/span>,<span style=\"color: #98c379;line-height: 26px;\">\"\/auth\/login\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<\/code><section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;color: black;line-height: 1.6;word-spacing: 0px;letter-spacing: 0px;word-break: break-word;word-wrap: break-word;text-align: left;margin-top: 0;padding: 0;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &#39;PingFang SC&#39;, Cambria, Cochin, Georgia, Times, &#39;Times New Roman&#39;, serif;\"><p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;margin: 0;font-size: 16px;line-height: 26px;word-spacing: 3px;letter-spacing: 1px;color: #424B5D;\"><br  \/><\/p><\/section><section><br  \/><\/section><\/pre>\n<\/section>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u4e00\u5b89\u672a\u6765              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u4e00\u5b89\uff0c\u4eca\u5929\u804a\u4e00\u4e0b\u5728\u4e0d\u96c6\u6210springcloud\u7684\u60c5\u51b5\u4e0b\uff0c\u5982\u4f55\u5229\u7528springboot+redis\uff0c\u5b9e\u73b0\u63a5\u53e3\u9650\u6d41\uff08\u9632\u6b62\u6076 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":2359,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[7],"tags":[],"class_list":["post-2361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/06\/20230627152141844.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Spring Boot","post_date":"2023-06-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":360,"next_post_id":2603,"next_post_title":"SpringBoot bean\u81ea\u52a8\u88c5\u914d\u539f\u7406\uff0c\u8fd9\u4e00\u7bc7\u5c31\u591f\u4e86\uff01","previous_post_id":2334,"previous_post_title":"Spring Boot + Mybatis Plus + ClickHouse \u8f7b\u677e\u5b9e\u73b0\u589e\u5220\u6539\u67e5\uff0c\u770b\u4e86\u5fc5\u61c2\uff01","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2361"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2361\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/2359"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}