From 1fae68d6b6876e47302426fb60b6f596832bfd33 Mon Sep 17 00:00:00 2001
From: zyx <1029606625@qq.com>
Date: Wed, 7 Jun 2023 15:43:44 +0800
Subject: [PATCH] 06/07 15:43
---
pom.xml | 4 ++
.../cn/czyx007/mt/config/RedisConfig.java | 37 +++++++++++++++++++
.../czyx007/mt/controller/DishController.java | 30 ++++++++++++++-
.../czyx007/mt/controller/UserController.java | 20 +++++++---
src/main/resources/application.yml | 15 +++++---
.../java/cn/czyx007/mt/ApplicationTests.java | 27 ++++++++++++++
6 files changed, 122 insertions(+), 11 deletions(-)
create mode 100644 src/main/java/cn/czyx007/mt/config/RedisConfig.java
diff --git a/pom.xml b/pom.xml
index 8948e50..fca7d29 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,6 +17,10 @@
11
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
com.alipay.sdk
alipay-sdk-java
diff --git a/src/main/java/cn/czyx007/mt/config/RedisConfig.java b/src/main/java/cn/czyx007/mt/config/RedisConfig.java
new file mode 100644
index 0000000..4e5734c
--- /dev/null
+++ b/src/main/java/cn/czyx007/mt/config/RedisConfig.java
@@ -0,0 +1,37 @@
+package cn.czyx007.mt.config;
+
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.GenericToStringSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * @author : 张宇轩
+ * @createTime : 2023/6/7 - 10:08
+ */
+
+@Configuration
+public class RedisConfig extends CachingConfigurerSupport {
+ @Bean
+ public RedisTemplate