diff --git a/pom.xml b/pom.xml
index 68c58c6..faef7aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,6 +25,15 @@
org.springframework.boot
spring-boot-starter-jdbc
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+ org.apache.commons
+ commons-pool2
+
com.baomidou
mybatis-plus-boot-starter
diff --git a/src/main/java/com/peteralbus/config/RedisConfig.java b/src/main/java/com/peteralbus/config/RedisConfig.java
new file mode 100644
index 0000000..c3497f4
--- /dev/null
+++ b/src/main/java/com/peteralbus/config/RedisConfig.java
@@ -0,0 +1,46 @@
+package com.peteralbus.config;
+
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+/**
+ * The type Redis config.
+ * @author PeterAlbus
+ */
+@Configuration
+public class RedisConfig {
+
+ /**
+ * Redis template redis template.
+ *
+ * @param factory the factory
+ * @return the redis template
+ */
+ @SuppressWarnings("all")
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory factory) {
+ RedisTemplate template = new RedisTemplate();
+ template.setConnectionFactory(factory);
+ Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
+ ObjectMapper om = new ObjectMapper();
+ om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+ om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ jackson2JsonRedisSerializer.setObjectMapper(om);
+ StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+ template.setKeySerializer(stringRedisSerializer);
+ template.setHashKeySerializer(stringRedisSerializer);
+ template.setValueSerializer(jackson2JsonRedisSerializer);
+ template.setHashValueSerializer(jackson2JsonRedisSerializer);
+ template.afterPropertiesSet();
+ return template;
+ }
+
+}
diff --git a/src/main/java/com/peteralbus/util/RedisUtils.java b/src/main/java/com/peteralbus/util/RedisUtils.java
new file mode 100644
index 0000000..0b3f22d
--- /dev/null
+++ b/src/main/java/com/peteralbus/util/RedisUtils.java
@@ -0,0 +1,219 @@
+package com.peteralbus.util;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.*;
+import org.springframework.stereotype.Component;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * The type Redis utils.
+ */
+@Component
+public class RedisUtils {
+
+ private RedisTemplate redisTemplate;
+
+ @Autowired
+ public void setRedisTemplate(RedisTemplate redisTemplate)
+ {
+ this.redisTemplate = redisTemplate;
+ }
+
+ /**
+ * 写入缓存
+ *
+ * @param key the key
+ * @param value the value
+ * @return boolean
+ */
+ public boolean set(final String key, Object value) {
+ boolean result = false;
+ try {
+ ValueOperations operations = redisTemplate.opsForValue();
+ operations.set(key, value);
+ result = true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ /**
+ * 写入缓存设置时效时间
+ *
+ * @param key the key
+ * @param value the value
+ * @param expireTime the expire time
+ * @param timeUnit the time unit
+ * @return boolean
+ */
+ public boolean set(final String key, Object value, Long expireTime , TimeUnit timeUnit) {
+ boolean result = false;
+ try {
+ ValueOperations operations = redisTemplate.opsForValue();
+ operations.set(key, value);
+ redisTemplate.expire(key, expireTime, timeUnit);
+ result = true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ /**
+ * 批量删除对应的value
+ *
+ * @param keys the keys
+ */
+ public void remove(final String... keys) {
+ for (String key : keys) {
+ remove(key);
+ }
+ }
+
+ /**
+ * 批量删除key
+ *
+ * @param pattern the pattern
+ */
+ public void removePattern(final String pattern) {
+ Set keys = redisTemplate.keys(pattern);
+ if (keys.size() > 0){
+ redisTemplate.delete(keys);
+ }
+ }
+
+ /**
+ * 删除对应的value
+ *
+ * @param key the key
+ */
+ public void remove(final String key) {
+ if (exists(key)) {
+ redisTemplate.delete(key);
+ }
+ }
+
+ /**
+ * 判断缓存中是否有对应的value
+ *
+ * @param key the key
+ * @return boolean
+ */
+ public boolean exists(final String key) {
+ return redisTemplate.hasKey(key);
+ }
+
+ /**
+ * 读取缓存
+ *
+ * @param key the key
+ * @return object
+ */
+ public Object get(final String key) {
+ Object result = null;
+ ValueOperations operations = redisTemplate.opsForValue();
+ result = operations.get(key);
+ return result;
+ }
+
+ /**
+ * 哈希 添加
+ *
+ * @param key the key
+ * @param hashKey the hash key
+ * @param value the value
+ */
+ public void hmSet(String key, Object hashKey, Object value){
+ HashOperations hash = redisTemplate.opsForHash();
+ hash.put(key,hashKey,value);
+ }
+
+ /**
+ * 哈希获取数据
+ *
+ * @param key the key
+ * @param hashKey the hash key
+ * @return object
+ */
+ public Object hmGet(String key, Object hashKey){
+ HashOperations hash = redisTemplate.opsForHash();
+ return hash.get(key,hashKey);
+ }
+
+ /**
+ * 列表添加
+ *
+ * @param k the k
+ * @param v the v
+ */
+ public void lPush(String k,Object v){
+ ListOperations list = redisTemplate.opsForList();
+ list.rightPush(k,v);
+ }
+
+ /**
+ * 列表获取
+ *
+ * @param k the k
+ * @param l the l
+ * @param l1 the l 1
+ * @return list
+ */
+ public List