From 829a86f74a3df3e96935959c0ea3d1cd2a288a3b Mon Sep 17 00:00:00 2001
From: sheng <2094038054@qq.com>
Date: Mon, 17 Apr 2023 12:01:49 +0800
Subject: [PATCH] =?UTF-8?q?redis=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 32 ++++++++++++-------
pom.xml | 4 +++
.../cn/edu/hactcm/config/RedisConfig.java | 24 ++++++++++++++
src/main/resources/application.yml | 4 +++
4 files changed, 53 insertions(+), 11 deletions(-)
create mode 100644 src/main/java/cn/edu/hactcm/config/RedisConfig.java
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 72db206..04f9be5 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,11 @@
-
+
+
+
+
+
@@ -19,6 +23,11 @@
+
@@ -153,6 +162,14 @@
+
+ 1681702796320
+
+
+
+ 1681702796320
+
+
@@ -169,15 +186,8 @@
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/cn/edu/hactcm/service/impl/OrdersServiceImpl.java
- 37
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index bef2595..65d6531 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,6 +80,10 @@
1.1.23
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
diff --git a/src/main/java/cn/edu/hactcm/config/RedisConfig.java b/src/main/java/cn/edu/hactcm/config/RedisConfig.java
new file mode 100644
index 0000000..ecfeacb
--- /dev/null
+++ b/src/main/java/cn/edu/hactcm/config/RedisConfig.java
@@ -0,0 +1,24 @@
+package cn.edu.hactcm.config;
+
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfig extends CachingConfigurerSupport {
+
+ @Bean
+ public RedisTemplate