{"id":4289,"date":"2024-03-27T08:56:33","date_gmt":"2024-03-27T00:56:33","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/spring-boot%e6%95%b4%e5%90%88redis\/"},"modified":"2024-03-27T08:56:33","modified_gmt":"2024-03-27T00:56:33","slug":"spring-boot%e6%95%b4%e5%90%88redis","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/spring-boot\/spring-boot%e6%95%b4%e5%90%88redis\/","title":{"rendered":"Spring Boot\u6574\u5408Redis"},"content":{"rendered":"<div class='wxsyncmain'>\n<h1 cid=\"n0\" mdtype=\"heading\" style=\"margin-top: 1rem;margin-bottom: 1rem;padding-bottom: 0.3em;outline: 0px;font-weight: bold;letter-spacing: 0.544px;white-space: pre-wrap;color: rgb(34, 34, 34);background-color: rgb(255, 255, 255);line-height: 1.2;cursor: text;border-bottom: 1px solid rgb(238, 238, 238);width: inherit;font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;text-align: start;visibility: visible;\"><span style=\"outline: 0px;color: rgb(178, 178, 178);visibility: visible;\">\u5982\u679c\u6587\u7ae0\u4e2d\u4ee3\u7801\u4e0d\u4fbf\u4e8e\u9605\u8bfb\uff0c\u8bf7\u4f7f\u7528\u7535\u8111\u67e5\u770b\u6216\u70b9\u51fb\u9605\u8bfb\u539f\u6587\u3002<\/span><\/h1>\n<p><span style=\"color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 2.25em;font-weight: bold;letter-spacing: normal;text-align: start;white-space-collapse: preserve;\">0 \u5f00\u53d1\u73af\u5883<\/span><\/p>\n<ul class=\"list-paddingleft-1\" cid=\"n2\" mdtype=\"list\" data-mark=\"-\" style=\"margin-top: 0.8em;margin-bottom: 0.8em;padding-left: 30px;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;text-wrap: wrap;\">\n<li>\n<p cid=\"n4\" mdtype=\"paragraph\" style=\"orphans: 4;margin-bottom: 0.5rem;white-space-collapse: preserve;\"><span md-inline=\"plain\">JDK\uff1a1.8<\/span><\/p>\n<\/li>\n<li>\n<p cid=\"n6\" mdtype=\"paragraph\" style=\"orphans: 4;margin-bottom: 0.5rem;white-space-collapse: preserve;\"><span md-inline=\"plain\">Spring Boot\uff1a2.7.18<\/span><\/p>\n<\/li>\n<\/ul>\n<h1 cid=\"n7\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">1 \u5bfc\u5165\u4f9d\u8d56<\/span><\/h1>\n<pre spellcheck=\"false\" lang=\"xml\" cid=\"n8\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(17, 119, 0);\">&lt;<\/span><span style=\"color: rgb(17, 119, 0);\">dependency<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(17, 119, 0);\">&lt;<\/span><span style=\"color: rgb(17, 119, 0);\">groupId<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span>org.springframework.boot<span style=\"color: rgb(17, 119, 0);\">&lt;\/<\/span><span style=\"color: rgb(17, 119, 0);\">groupId<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(17, 119, 0);\">&lt;<\/span><span style=\"color: rgb(17, 119, 0);\">artifactId<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span>spring-boot-starter-data-redis<span style=\"color: rgb(17, 119, 0);\">&lt;\/<\/span><span style=\"color: rgb(17, 119, 0);\">artifactId<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(17, 119, 0);\">&lt;\/<\/span><span style=\"color: rgb(17, 119, 0);\">dependency<\/span><span style=\"color: rgb(17, 119, 0);\">&gt;<\/span><\/span><\/pre>\n<h1 cid=\"n9\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">2 \u914d\u7f6e\u8fde\u63a5<\/span><\/h1>\n<pre spellcheck=\"false\" lang=\"yml\" cid=\"n10\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(34, 17, 153);\">spring<\/span><span style=\"color: rgb(85, 85, 85);\">:<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(34, 17, 153);\">  redis<\/span><span style=\"color: rgb(85, 85, 85);\">:<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(34, 17, 153);\">   host<\/span><span style=\"color: rgb(85, 85, 85);\">: <\/span><span style=\"color: rgb(17, 102, 68);\">127.0.0.1<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(34, 17, 153);\">   port<\/span><span style=\"color: rgb(85, 85, 85);\">: <\/span><span style=\"color: rgb(17, 102, 68);\">6379<\/span><\/span><\/pre>\n<p cid=\"n11\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u4ee3\u7801\u4e2d\u9ed8\u8ba4host\u662flocalhost\uff0c\u9ed8\u8ba4port\u662f6379<\/span><\/p>\n<h1 cid=\"n12\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">3 \u6d4b\u8bd5<\/span><\/h1>\n<h2 cid=\"n13\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">3.1 \u65b0\u5efa\u542f\u52a8\u7c7b<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n14\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@SpringBootApplication<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisApplication<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">static<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">main<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span>[] <span style=\"color: rgb(0, 0, 0);\">args<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">SpringApplication<\/span>.<span style=\"color: rgb(0, 0, 0);\">run<\/span>(<span style=\"color: rgb(0, 0, 0);\">RedisApplication<\/span>.<span style=\"color: rgb(119, 0, 136);\">class<\/span>, <span style=\"color: rgb(0, 0, 0);\">args<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n15\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">3.2 \u65b0\u5efa\u6d4b\u8bd5\u7c7b<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n16\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@SpringBootTest<\/span>(<span style=\"color: rgb(0, 0, 0);\">classes<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisApplication<\/span>.<span style=\"color: rgb(119, 0, 136);\">class<\/span>, <span style=\"color: rgb(0, 0, 0);\">webEnvironment<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">SpringBootTest<\/span>.<span style=\"color: rgb(0, 0, 0);\">WebEnvironment<\/span>.<span style=\"color: rgb(0, 0, 0);\">DEFINED_PORT<\/span>)<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisApplicationTest<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Autowired<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Test<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">contextLoads<\/span>() {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_key\"<\/span>, <span style=\"color: rgb(170, 17, 17);\">\"test_value\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">System<\/span>.<span style=\"color: rgb(0, 0, 0);\">out<\/span>.<span style=\"color: rgb(0, 0, 0);\">println<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_key\"<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n17\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">3.3 \u6d4b\u8bd5<\/span><\/h2>\n<p cid=\"n18\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u542f\u52a8\u6d4b\u8bd5\u7c7b\uff0c\u6210\u529f\u4fdd\u5b58\u5e76\u53d6\u51fa\u6253\u5370<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000536\" data-ratio=\"0.5180467091295117\" data-s=\"300,640\" data-type=\"png\" data-w=\"471\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000536\" data-ratio=\"0.5180467091295117\" data-s=\"300,640\" data-type=\"png\" data-w=\"471\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png\"  \/><\/noscript><\/p>\n<p cid=\"n20\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u542f\u52a8Redis\u5ba2\u6237\u7aef\uff0c\u67e5\u770b\u6570\u636e\uff0c\u4fdd\u5b58\u6210\u529f\u3002<\/span><\/p>\n<p cid=\"n21\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u8fd9\u91cc\u6570\u636e\u6709\u4e71\u7801\uff0c\u662f\u56e0\u4e3a\u9ed8\u8ba4\u7684\u5e8f\u5217\u5316\u65b9\u5f0f\u662fJDK\u5e8f\u5217\u5316\uff0c\u540e\u9762\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Json\u6765\u5e8f\u5217\u5316\u89e3\u51b3\u8be5\u95ee\u9898\u3002<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000537\" data-ratio=\"0.358600583090379\" data-s=\"300,640\" data-type=\"png\" data-w=\"343\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152434563.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000537\" data-ratio=\"0.358600583090379\" data-s=\"300,640\" data-type=\"png\" data-w=\"343\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152434563.png\"  \/><\/noscript><\/p>\n<h1 cid=\"n23\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4 \u5bf9\u8c61\u5e8f\u5217\u5316<\/span><\/h1>\n<p cid=\"n24\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"html_inline\" spellcheck=\"false\" style=\"white-space-collapse: collapse;\"><span style=\"color:red;\"><span md-inline=\"strong\"><strong>\u5728\u5f00\u53d1\u4e2d\uff0c\u6240\u6709\u7684\u5bf9\u8c61\u5b58\u50a8\u5230Redis\u4e2d\u90fd\u9700\u5e8f\u5217\u5316<\/strong><\/span><\/span><\/span><\/p>\n<h2 cid=\"n25\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4.1 \u65b0\u5efaUserModel<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n26\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"> <span style=\"color: rgb(170, 85, 0);\">* \u672a\u5e8f\u5217\u5316\uff0c\u9519\u8bef\u793a\u8303<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"> <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@Data<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@AllArgsConstructor<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@NoArgsConstructor<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">UserModel<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 136, 85);\">int<\/span> <span style=\"color: rgb(0, 0, 0);\">id<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">name<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n27\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4.2 \u8c03\u6574\u6d4b\u8bd5\u7c7b<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n28\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Test<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 255);\">contextLoadsUser<\/span>() {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">UserModel<\/span> <span style=\"color: rgb(0, 0, 0);\">user<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">UserModel<\/span>(<span style=\"color: rgb(17, 102, 68);\">1<\/span>, <span style=\"color: rgb(170, 17, 17);\">\"\u6d4b\u8bd5\u59d3\u540d\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_user\"<\/span>, <span style=\"color: rgb(0, 0, 0);\">user<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">System<\/span>.<span style=\"color: rgb(0, 0, 0);\">out<\/span>.<span style=\"color: rgb(0, 0, 0);\">println<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_user\"<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><\/pre>\n<h2 cid=\"n29\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4.3 \u6d4b\u8bd5<\/span><\/h2>\n<p cid=\"n30\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u542f\u52a8\u6d4b\u8bd5\u7c7b\uff0c\u7a0b\u5e8f\u62a5\u9519<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000538\" data-ratio=\"0.21574074074074073\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152435198.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000538\" data-ratio=\"0.21574074074074073\" data-s=\"300,640\" data-type=\"png\" data-w=\"1080\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152435198.png\"  \/><\/noscript><\/p>\n<h2 cid=\"n32\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4.4 \u8c03\u6574UserModel<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n33\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@Data<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@AllArgsConstructor<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@NoArgsConstructor<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">UserModel<\/span> <span style=\"color: rgb(119, 0, 136);\">implements<\/span> <span style=\"color: rgb(0, 0, 0);\">Serializable<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 136, 85);\">int<\/span> <span style=\"color: rgb(0, 0, 0);\">id<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">name<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n34\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">4.5 \u6d4b\u8bd5<\/span><\/h2>\n<p cid=\"n35\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u518d\u6b21\u542f\u52a8\u6d4b\u8bd5\u7c7b\uff0c\u6570\u636e\u6210\u529f\u4fdd\u5b58\u5e76\u53d6\u51fa\u6253\u5370<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000540\" data-ratio=\"0.42358803986710963\" data-s=\"300,640\" data-type=\"png\" data-w=\"602\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152438831.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000540\" data-ratio=\"0.42358803986710963\" data-s=\"300,640\" data-type=\"png\" data-w=\"602\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152438831.png\"  \/><\/noscript><\/p>\n<p cid=\"n37\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u8fd9\u6837\uff0c\u6211\u4eec\u5c31\u80fd\u4fdd\u5b58\u5b57\u7b26\u4e32\u548cJava\u5bf9\u8c61\u4e86\u3002<\/span><\/p>\n<p cid=\"n38\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u7136\u540e\u9488\u5bf9\u524d\u9762\u6240\u8bf4\u7684\u6570\u636e\u4e71\u7801\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u5b9a\u4e49RedisTemplate<\/span><\/p>\n<h1 cid=\"n39\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">5 \u81ea\u5b9a\u4e49RedisTemplate<\/span><\/h1>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n40\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@Configuration<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisConfig<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Bean<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>(<span style=\"color: rgb(0, 0, 0);\">RedisConnectionFactory<\/span> <span style=\"color: rgb(0, 0, 0);\">redisConnectionFactory<\/span>) <span style=\"color: rgb(119, 0, 136);\">throws<\/span> <span style=\"color: rgb(0, 0, 0);\">UnknownHostException<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">template<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;&gt;<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setConnectionFactory<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisConnectionFactory<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/JSON\u5e8f\u5217\u5316\u914d\u7f6e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">ObjectMapper<\/span> <span style=\"color: rgb(0, 0, 0);\">objectMapper<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">ObjectMapper<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">objectMapper<\/span>.<span style=\"color: rgb(0, 0, 0);\">setVisibility<\/span>(<span style=\"color: rgb(0, 0, 0);\">PropertyAccessor<\/span>.<span style=\"color: rgb(0, 0, 0);\">ALL<\/span>, <span style=\"color: rgb(0, 0, 0);\">JsonAutoDetect<\/span>.<span style=\"color: rgb(0, 0, 0);\">Visibility<\/span>.<span style=\"color: rgb(0, 0, 0);\">ANY<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">objectMapper<\/span>.<span style=\"color: rgb(0, 0, 0);\">enableDefaultTyping<\/span>(<span style=\"color: rgb(0, 0, 0);\">ObjectMapper<\/span>.<span style=\"color: rgb(0, 0, 0);\">DefaultTyping<\/span>.<span style=\"color: rgb(0, 0, 0);\">NON_FINAL<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">Jackson2JsonRedisSerializer<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">jackson2JsonRedisSerializer<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">Jackson2JsonRedisSerializer<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;&gt;<\/span>(<span style=\"color: rgb(0, 136, 85);\">Object<\/span>.<span style=\"color: rgb(119, 0, 136);\">class<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">jackson2JsonRedisSerializer<\/span>.<span style=\"color: rgb(0, 0, 0);\">setObjectMapper<\/span>(<span style=\"color: rgb(0, 0, 0);\">objectMapper<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/String\u5e8f\u5217\u5316\u914d\u7f6e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">StringRedisSerializer<\/span> <span style=\"color: rgb(0, 0, 0);\">stringRedisSerializer<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">StringRedisSerializer<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/key\u91c7\u7528String\u7684\u5e8f\u5217\u5316\u65b9\u5f0f<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setKeySerializer<\/span>(<span style=\"color: rgb(0, 0, 0);\">stringRedisSerializer<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/hash\u7684key\u91c7\u7528String\u7684\u5e8f\u5217\u5316\u65b9\u5f0f<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setHashKeySerializer<\/span>(<span style=\"color: rgb(0, 0, 0);\">stringRedisSerializer<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/value\u5e8f\u5217\u5316\u65b9\u5f0f\u91c7\u7528jackson<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setValueSerializer<\/span>(<span style=\"color: rgb(0, 0, 0);\">jackson2JsonRedisSerializer<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/hash\u7684value\u5e8f\u5217\u5316\u65b9\u5f0f\u91c7\u7528jackson<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setHashValueSerializer<\/span>(<span style=\"color: rgb(0, 0, 0);\">jackson2JsonRedisSerializer<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">afterPropertiesSet<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(170, 85, 0);\">\/\/\u5f00\u542f\u4e8b\u52a1<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">template<\/span>.<span style=\"color: rgb(0, 0, 0);\">setEnableTransactionSupport<\/span>(<span style=\"color: rgb(34, 17, 153);\">true<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">template<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h1 cid=\"n41\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">6 \u6d4b\u8bd5<\/span><\/h1>\n<h2 cid=\"n42\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">6.1 \u8c03\u6574\u6d4b\u8bd5\u7c7b<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n43\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@SpringBootTest<\/span>(<span style=\"color: rgb(0, 0, 0);\">classes<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisApplication<\/span>.<span style=\"color: rgb(119, 0, 136);\">class<\/span>, <span style=\"color: rgb(0, 0, 0);\">webEnvironment<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">SpringBootTest<\/span>.<span style=\"color: rgb(0, 0, 0);\">WebEnvironment<\/span>.<span style=\"color: rgb(0, 0, 0);\">DEFINED_PORT<\/span>)<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisApplicationTest<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Autowired<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Qualifier<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"redisTemplate\"<\/span>)<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Test<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">contextLoads<\/span>() {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_key\"<\/span>, <span style=\"color: rgb(170, 17, 17);\">\"test_value\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">System<\/span>.<span style=\"color: rgb(0, 0, 0);\">out<\/span>.<span style=\"color: rgb(0, 0, 0);\">println<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_key\"<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n44\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">6.2 \u6d4b\u8bd5<\/span><\/h2>\n<p cid=\"n45\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">Redis\u5ba2\u6237\u7aef\u4e2d\u6267\u884c<\/span><span md-inline=\"strong\"><strong>flushdb<\/strong><\/span><span md-inline=\"plain\">\u6e05\u7a7a\u6570\u636e\uff0c\u518d\u6b21\u6267\u884c\u521a\u624d\u7684\u6d4b\u8bd5\u7c7b\uff0c\u5ba2\u6237\u7aef\u4e2d\u67e5\u770b\u6570\u636e\uff0c\u6570\u636e\u4fdd\u5b58\u6210\u529f\uff0c\u4e14\u65e0\u4e71\u7801<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000541\" data-ratio=\"0.47692307692307695\" data-s=\"300,640\" data-type=\"png\" data-w=\"325\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152440913.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000541\" data-ratio=\"0.47692307692307695\" data-s=\"300,640\" data-type=\"png\" data-w=\"325\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152440913.png\"  \/><\/noscript><\/p>\n<p cid=\"n47\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u4f46\u662f\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u57fa\u672c\u662f\u4e0d\u4f1a\u4f7f\u7528\u539f\u751f\u7684\u65b9\u6cd5\u6765\u5b58\u53d6\u6570\u636e\u7684\uff0c\u5f62\u5982redisTemplate.opsForValue().set()\u7f16\u5199\u4ee3\u7801\u6bd4\u8f83\u9ebb\u70e6\u3002<\/span><\/p>\n<p cid=\"n48\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u901a\u5e38\uff0c\u6211\u4eec\u4f1a\u81ea\u5b9a\u4e49\u5de5\u5177\u7c7b\uff0c\u540e\u7eed\u64cd\u4f5c\u6570\u636e\u90fd\u901a\u8fc7\u5de5\u5177\u7c7b\u6765\u5904\u7406\u3002<\/span><\/p>\n<h1 cid=\"n49\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">7 \u81ea\u5b9a\u4e49\u5de5\u5177\u7c7b<\/span><\/h1>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n50\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@Component<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisUtils<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Autowired<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisTemplate<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u6307\u5b9a\u7f13\u5b58\u5931\u6548\u65f6\u95f4<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2)<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>, <span style=\"color: rgb(0, 0, 0);\">TimeUnit<\/span>.<span style=\"color: rgb(0, 0, 0);\">SECONDS<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u6839\u636ekey\u83b7\u53d6\u8fc7\u671f\u65f6\u95f4<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u65f6\u95f4(\u79d2) 0 \u6c38\u4e45\u6709\u6548<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">getExpire<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">getExpire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">TimeUnit<\/span>.<span style=\"color: rgb(0, 0, 0);\">SECONDS<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5224\u65adkey\u662f\u5426\u5b58\u5728<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u5b58\u5728 false \u4e0d\u5b58\u5728<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">hasKey<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">StringUtils<\/span>.<span style=\"color: rgb(0, 0, 0);\">isEmpty<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>)) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 136, 85);\">Boolean<\/span>.<span style=\"color: rgb(0, 0, 0);\">TRUE<\/span>.<span style=\"color: rgb(0, 0, 0);\">equals<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">hasKey<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u666e\u901a\u7f13\u5b58\u83b7\u53d6<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span> <span style=\"color: rgb(152, 26, 26);\">==<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> <span style=\"color: rgb(152, 26, 26);\">?<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> : <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u666e\u901a\u7f13\u5b58\u653e\u5165<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false \u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u666e\u901a\u7f13\u5b58\u653e\u5165\u5e76\u8bbe\u7f6e\u65f6\u95f4<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value  \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2) time\u8981\u5927\u4e8e0\uff0c\u5982\u679ctime\u5c0f\u4e8e\u7b49\u4e8e0\uff0c\u5c06\u8bbe\u7f6e\u65e0\u9650\u671f<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false \u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&lt;=<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>, <span style=\"color: rgb(0, 0, 0);\">TimeUnit<\/span>.<span style=\"color: rgb(0, 0, 0);\">SECONDS<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5220\u9664\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param keys \u53ef\u4ee5\u4f20\u4e00\u4e2a\u503c\u6216\u591a\u4e2a<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">delete<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span>... <span style=\"color: rgb(0, 0, 0);\">keys<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">keys<\/span> <span style=\"color: rgb(152, 26, 26);\">==<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> <span style=\"color: rgb(152, 26, 26);\">||<\/span> <span style=\"color: rgb(0, 0, 0);\">keys<\/span>.<span style=\"color: rgb(0, 0, 0);\">length<\/span> <span style=\"color: rgb(152, 26, 26);\">&lt;=<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">keys<\/span>.<span style=\"color: rgb(0, 0, 0);\">length<\/span> <span style=\"color: rgb(152, 26, 26);\">==<\/span> <span style=\"color: rgb(17, 102, 68);\">1<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">delete<\/span>(<span style=\"color: rgb(0, 0, 0);\">keys<\/span>[<span style=\"color: rgb(17, 102, 68);\">0<\/span>]);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">else<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">delete<\/span>((<span style=\"color: rgb(0, 0, 0);\">Collection<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span>) <span style=\"color: rgb(0, 0, 0);\">CollectionUtils<\/span>.<span style=\"color: rgb(0, 0, 0);\">arrayToList<\/span>(<span style=\"color: rgb(0, 0, 0);\">keys<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u589e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @throws Exception<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">delta<\/span> <span style=\"color: rgb(152, 26, 26);\">&lt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">throw<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">RuntimeException<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"\u9012\u589e\u56e0\u5b50\u5fc5\u987b &gt; 0\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u51cf<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @throws Exception<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">decrement<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">delta<\/span> <span style=\"color: rgb(152, 26, 26);\">&lt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">throw<\/span> <span style=\"color: rgb(119, 0, 136);\">new<\/span> <span style=\"color: rgb(0, 0, 0);\">RuntimeException<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"\u9012\u51cf\u56e0\u5b50\u5fc5\u987b &gt; 0\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForValue<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(152, 26, 26);\">-<\/span><span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5224\u65adhash\u8868\u4e2d\u662f\u5426\u6709\u8be5\u9879\u7684\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey \u9879 \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u5b58\u5728 false \u4e0d\u5b58\u5728<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">hasKeyHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 136, 85);\">Boolean<\/span>.<span style=\"color: rgb(0, 0, 0);\">TRUE<\/span>.<span style=\"color: rgb(0, 0, 0);\">equals<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">hasKey<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u83b7\u53d6\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey \u9879 \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">getHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span> <span style=\"color: rgb(152, 26, 26);\">==<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> <span style=\"color: rgb(152, 26, 26);\">?<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> : <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5411\u4e00\u5f20hash\u8868\u4e2d\u653e\u5165\u6570\u636e\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5c06\u521b\u5efa<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey \u9879<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value  \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false\u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">setHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">put<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5411\u4e00\u5f20hash\u8868\u4e2d\u653e\u5165\u6570\u636e\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5c06\u521b\u5efa<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey \u9879<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value  \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2) \u6ce8\u610f\uff1a\u5982\u679c\u5df2\u5b58\u5728\u7684hash\u8868\u6709\u65f6\u95f4,\u8fd9\u91cc\u5c06\u4f1a\u66ff\u6362\u539f\u6709\u7684\u65f6\u95f4<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false \u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">setHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">put<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5220\u9664hash\u8868\u4e2d\u7684\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key    \u952e \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKeys \u9879 \u53ef\u4ee5\u662f\u591a\u4e2a \u4e0d\u80fd\u4e3anull<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">deleteHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span>... <span style=\"color: rgb(0, 0, 0);\">hashKeys<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">delete<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKeys<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u589e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">incrementHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u589e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">double<\/span> <span style=\"color: rgb(0, 0, 0);\">incrementHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">double<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u51cf<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">decrementHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(152, 26, 26);\">-<\/span><span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u9012\u51cf<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param hashKey<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param delta<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">double<\/span> <span style=\"color: rgb(0, 0, 0);\">decrementHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(0, 136, 85);\">double<\/span> <span style=\"color: rgb(0, 0, 0);\">delta<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">increment<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">hashKey<\/span>, <span style=\"color: rgb(152, 26, 26);\">-<\/span><span style=\"color: rgb(0, 0, 0);\">delta<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u83b7\u53d6key\u5bf9\u5e94\u7684\u6240\u6709\u952e\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u5bf9\u5e94\u7684\u591a\u4e2a\u952e\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 0, 0);\">Map<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">getHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span> <span style=\"color: rgb(152, 26, 26);\">==<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> <span style=\"color: rgb(152, 26, 26);\">?<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span> : <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">entries<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param map \u5bf9\u5e94\u591a\u4e2a\u952e\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false \u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">setHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">Map<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">map<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">putAll<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">map<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u7f13\u5b58\u5e76\u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param map   \u5bf9\u5e94\u591a\u4e2a\u952e\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2)<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u6210\u529f false \u5931\u8d25<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">setHash<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">Map<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">String<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">map<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForHash<\/span>().<span style=\"color: rgb(0, 0, 0);\">putAll<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">map<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u6839\u636ekey\u83b7\u53d6Set\u4e2d\u7684\u6240\u6709\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 0, 0);\">Set<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">membersSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">members<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u6839\u636evalue\u4ece\u4e00\u4e2aset\u4e2d\u67e5\u8be2\uff0c\u662f\u5426\u5b58\u5728<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return true \u5b58\u5728 false \u4e0d\u5b58\u5728<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">isMemberSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 136, 85);\">Boolean<\/span>.<span style=\"color: rgb(0, 0, 0);\">TRUE<\/span>.<span style=\"color: rgb(0, 0, 0);\">equals<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">isMember<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06\u6570\u636e\u653e\u5165set\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param values \u503c \u53ef\u4ee5\u662f\u591a\u4e2a<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u6210\u529f\u4e2a\u6570<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">addSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span>... <span style=\"color: rgb(0, 0, 0);\">values<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">add<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">values<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06set\u6570\u636e\u653e\u5165\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2)<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param values  \u503c \u53ef\u4ee5\u662f\u591a\u4e2a<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u6210\u529f\u4e2a\u6570<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">addSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span>... <span style=\"color: rgb(0, 0, 0);\">values<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 136, 85);\">Long<\/span> <span style=\"color: rgb(0, 0, 0);\">count<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">add<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">values<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">count<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u83b7\u53d6set\u7f13\u5b58\u7684\u957f\u5ea6<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">sizeSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">size<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u79fb\u9664\u503c\u4e3avalue\u7684<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param values \u503c \u53ef\u4ee5\u662f\u591a\u4e2a<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u79fb\u9664\u7684\u4e2a\u6570<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">removeSet<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span>... <span style=\"color: rgb(0, 0, 0);\">values<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForSet<\/span>().<span style=\"color: rgb(0, 0, 0);\">remove<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">values<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u83b7\u53d6list\u7f13\u5b58\u7684\u5185\u5bb9<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param start \u5f00\u59cb<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param end  \u7ed3\u675f  0\u5230-1\u4ee3\u8868\u6240\u6709\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 0, 0);\">List<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">rangeList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">start<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">end<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">range<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">start<\/span>, <span style=\"color: rgb(0, 0, 0);\">end<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u83b7\u53d6list\u7f13\u5b58\u7684\u957f\u5ea6<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">sizeList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">size<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u901a\u8fc7\u7d22\u5f15\u83b7\u53d6list\u4e2d\u7684\u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param index \u7d22\u5f15  index&gt;=0\u65f6\uff0c0 \u8868\u5934\uff0c1 \u7b2c\u4e8c\u4e2a\u5143\u7d20\uff0c\u4f9d\u6b21\u7c7b\u63a8\uff1bindex&lt;0\u65f6\uff0c-1\uff0c\u8868\u5c3e\uff0c-2\u5012\u6570\u7b2c\u4e8c\u4e2a\u5143\u7d20\uff0c\u4f9d\u6b21\u7c7b\u63a8<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">indexList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">index<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">index<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">index<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">null<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06list\u653e\u5165\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">rightPushList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">rightPush<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06list\u653e\u5165\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value  \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2)<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">rightPushList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">rightPush<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06list\u653e\u5165\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">rightPushList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">List<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">rightPushAll<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u5c06list\u653e\u5165\u7f13\u5b58<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key   \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value  \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param timeout \u65f6\u95f4(\u79d2)<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">rightPushList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">List<\/span><span style=\"color: rgb(152, 26, 26);\">&lt;<\/span><span style=\"color: rgb(0, 136, 85);\">Object<\/span><span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">rightPushAll<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">if<\/span> (<span style=\"color: rgb(0, 0, 0);\">timeout<\/span> <span style=\"color: rgb(152, 26, 26);\">&gt;<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">        <span style=\"color: rgb(0, 0, 0);\">expire<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">timeout<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">       }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u6839\u636e\u7d22\u5f15\u4fee\u6539list\u4e2d\u7684\u67d0\u6761\u6570\u636e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param index \u7d22\u5f15<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">boolean<\/span> <span style=\"color: rgb(0, 0, 0);\">setList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">index<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">index<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">true<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(34, 17, 153);\">false<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(170, 85, 0);\">\/**<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* \u79fb\u9664N\u4e2a\u503c\u4e3avalue\u7684\u6570\u636e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param key  \u952e<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param count \u79fb\u9664\u591a\u5c11\u4e2a<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @param value \u503c<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">* @return \u79fb\u9664\u7684\u4e2a\u6570<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   <span style=\"color: rgb(170, 85, 0);\">*\/<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">removeList<\/span>(<span style=\"color: rgb(0, 136, 85);\">String<\/span> <span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 136, 85);\">long<\/span> <span style=\"color: rgb(0, 0, 0);\">count<\/span>, <span style=\"color: rgb(0, 136, 85);\">Object<\/span> <span style=\"color: rgb(0, 0, 0);\">value<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(119, 0, 136);\">try<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(0, 0, 0);\">redisTemplate<\/span>.<span style=\"color: rgb(0, 0, 0);\">opsForList<\/span>().<span style=\"color: rgb(0, 0, 0);\">remove<\/span>(<span style=\"color: rgb(0, 0, 0);\">key<\/span>, <span style=\"color: rgb(0, 0, 0);\">count<\/span>, <span style=\"color: rgb(0, 0, 0);\">value<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     } <span style=\"color: rgb(119, 0, 136);\">catch<\/span> (<span style=\"color: rgb(0, 0, 0);\">Exception<\/span> <span style=\"color: rgb(0, 0, 0);\">e<\/span>) {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(0, 0, 0);\">e<\/span>.<span style=\"color: rgb(0, 0, 0);\">printStackTrace<\/span>();<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">      <span style=\"color: rgb(119, 0, 136);\">return<\/span> <span style=\"color: rgb(17, 102, 68);\">0<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">     }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h1 cid=\"n51\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 2.25em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.2;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">8 \u6d4b\u8bd5<\/span><\/h1>\n<h2 cid=\"n52\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">8.1 \u8c03\u6574\u6d4b\u8bd5\u7c7b<\/span><\/h2>\n<pre spellcheck=\"false\" lang=\"java\" cid=\"n53\" mdtype=\"fences\" style=\"overflow: visible;font-family: var(--monospace);font-size: 0.9em;break-inside: avoid;text-align: left;white-space: normal;background-image: inherit;background-position: inherit;background-size: inherit;background-repeat: inherit;background-attachment: inherit;background-origin: inherit;background-clip: inherit;background-color: rgb(248, 248, 248);border-width: 1px;border-style: solid;border-color: rgb(231, 234, 237);border-radius: 3px;padding-top: 8px;padding-right: 4px;padding-bottom: 6px;margin-bottom: 15px;margin-top: 15px;width: inherit;color: rgb(51, 51, 51);letter-spacing: normal;\"><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(85, 85, 85);\">@SpringBootTest<\/span>(<span style=\"color: rgb(0, 0, 0);\">classes<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisApplication<\/span>.<span style=\"color: rgb(119, 0, 136);\">class<\/span>, <span style=\"color: rgb(0, 0, 0);\">webEnvironment<\/span> <span style=\"color: rgb(152, 26, 26);\">=<\/span> <span style=\"color: rgb(0, 0, 0);\">SpringBootTest<\/span>.<span style=\"color: rgb(0, 0, 0);\">WebEnvironment<\/span>.<span style=\"color: rgb(0, 0, 0);\">DEFINED_PORT<\/span>)<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(119, 0, 136);\">class<\/span> <span style=\"color: rgb(0, 0, 255);\">RedisApplicationTest<\/span> {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Autowired<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">private<\/span> <span style=\"color: rgb(0, 0, 0);\">RedisUtils<\/span> <span style=\"color: rgb(0, 0, 0);\">redisUtils<\/span>;<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\"><span cm-text=\"\"><\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(85, 85, 85);\">@Test<\/span><\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">  <span style=\"color: rgb(119, 0, 136);\">public<\/span> <span style=\"color: rgb(0, 136, 85);\">void<\/span> <span style=\"color: rgb(0, 0, 0);\">contextLoadsUtil<\/span>() {<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">redisUtils<\/span>.<span style=\"color: rgb(0, 0, 0);\">set<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_utils_key\"<\/span>, <span style=\"color: rgb(170, 17, 17);\">\"test_utils_value\"<\/span>);<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">    <span style=\"color: rgb(0, 0, 0);\">System<\/span>.<span style=\"color: rgb(0, 0, 0);\">out<\/span>.<span style=\"color: rgb(0, 0, 0);\">println<\/span>(<span style=\"color: rgb(0, 0, 0);\">redisUtils<\/span>.<span style=\"color: rgb(0, 0, 0);\">get<\/span>(<span style=\"color: rgb(170, 17, 17);\">\"test_utils_key\"<\/span>));<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">   }<\/span><span role=\"presentation\" style=\"padding-right: 0.1px;\">}<\/span><\/pre>\n<h2 cid=\"n54\" mdtype=\"heading\" style=\"break-after: avoid-page;break-inside: avoid;font-size: 1.75em;margin-top: 1rem;margin-bottom: 1rem;font-weight: bold;line-height: 1.225;cursor: text;padding-bottom: 0.3em;border-bottom: 1px solid rgb(238, 238, 238);white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">8.2 \u6d4b\u8bd5<\/span><\/h2>\n<p cid=\"n55\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u542f\u52a8\u6d4b\u8bd5\u7c7b\uff0c\u6210\u529f\u4fdd\u5b58\u5e76\u53d6\u51fa\u6253\u5370<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-galleryid=\"\" data-imgfileid=\"100000539\" data-ratio=\"0.5056818181818182\" data-s=\"300,640\" data-type=\"png\" data-w=\"528\" style=\"height: auto !important;\"  data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152441334.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-imgfileid=\"100000539\" data-ratio=\"0.5056818181818182\" data-s=\"300,640\" data-type=\"png\" data-w=\"528\" style=\"height: auto !important;\"  src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152441334.png\"  \/><\/noscript><\/p>\n<p cid=\"n57\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">\u81f3\u6b64\uff0cSpring Boot\u6574\u5408Redis\u5b8c\u6210\u4e14\u6d4b\u8bd5\u901a\u8fc7\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u5bf9\u4e8eRedis\u7684\u76f8\u5173\u64cd\u4f5c\u8fd8\u662f\u6bd4\u8f83\u7b80\u5355\u7684\uff0c\u5173\u952e\u5728\u4e8e\u7406\u89e3Redis\u7684\u601d\u60f3\u548c\u6bcf\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u7684\u7528\u6cd5\u548c\u4f5c\u7528\u573a\u666f\u3002<\/span><\/p>\n<p cid=\"n59\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\">\n<hr style=\"box-sizing: content-box;height: 2px;margin-top: 16px;margin-bottom: 16px;border-width: 0px;border-style: none;border-color: initial;background-color: rgb(231, 231, 231);\"  \/>\n<p cid=\"n62\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\">CSDN\uff1a<\/span><span md-inline=\"link\"><span md-inline=\"plain\">https:\/\/blog.csdn.net\/dkbnull\/article\/details\/137062282<\/span><\/span><\/p>\n<hr style=\"margin-top: 16px;margin-bottom: 16px;box-sizing: content-box;letter-spacing: 0.578px;text-wrap: wrap;height: 2px;border-width: 0px;border-style: none;border-color: initial;background-color: rgb(231, 231, 231);\"  \/>\n<p cid=\"n62\" mdtype=\"paragraph\" style=\"margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;orphans: 4;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\">\n<p cid=\"n64\" mdtype=\"paragraph\" style=\"orphans: 4;margin-top: 0.8em;margin-bottom: 0.8em;white-space: pre-wrap;color: rgb(51, 51, 51);font-family: &quot;Open Sans&quot;, &quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;font-size: 16px;letter-spacing: normal;text-align: start;\"><span md-inline=\"plain\"><\/span><\/p>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u7a0b\u5e8f\u5458null              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u6587\u7ae0\u4e2d\u4ee3\u7801\u4e0d\u4fbf\u4e8e\u9605\u8bfb\uff0c\u8bf7\u4f7f\u7528\u7535\u8111\u67e5\u770b\u6216\u70b9\u51fb\u9605\u8bfb\u539f\u6587\u3002 0 \u5f00\u53d1\u73af\u5883 JDK\uff1a1.8 Spring Boot\uff1a2.7.18 1  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[18,7],"tags":[],"class_list":["post-4289","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-redis","category-spring-boot"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509-300x127.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509-1024x435.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509-300x127.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152428509.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152432716.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152434563.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152434563.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152435198.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152435198.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152438831.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152438831.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152440913.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152440913.png","id":"image9"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152441334.png","id":"image10"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240524152441334.png","id":"image11"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Redis","post_date":"2024-03-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":613,"next_post_id":4194,"next_post_title":"Spring Boot\u5f15\u5165\u5916\u90e8jar\u5305\u5e76\u6253\u5305","previous_post_id":4307,"previous_post_title":"Spring Boot\u6574\u5408Spring Security","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4289","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=4289"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4289\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/4280"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}