diff --git a/.gitignore b/.gitignore
index 9c0418d..0bbf947 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
target/
\.DS_Store
+
+*.iml
diff --git a/pom.xml b/pom.xml
index 29e76e5..b942a7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,11 +6,12 @@
com.irrigation
common-lib
- 1.0-SNAPSHOT
+ 1.2.0
UTF-8
1.8
+ 1.5.10.RELEASE
2.7.0
1.16.20
1.11
@@ -19,6 +20,8 @@
1.2.46
4.3.14.RELEASE
4.2.4.RELEASE
+ 2.6.11
+
@@ -83,6 +86,36 @@
${spring-security-core.version}
provided
+
+ net.sf.ehcache
+ ehcache-core
+ ${ehcache.version}
+
+
+ org.slf4j
+ slf4j-api
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-cache
+ ${spring-boot.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+ ${spring-boot.version}
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ ${spring-boot.version}
+
+
diff --git a/src/main/java/com/irrigation/icl/cache/Command.java b/src/main/java/com/irrigation/icl/cache/Command.java
new file mode 100644
index 0000000..6e12468
--- /dev/null
+++ b/src/main/java/com/irrigation/icl/cache/Command.java
@@ -0,0 +1,68 @@
+package com.irrigation.icl.cache;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Command
+ */
+@Data
+public class Command implements Serializable {
+
+ private static final long serialVersionUID = 7126530485423286910L;
+
+ // 设置本地缓存
+ public final static byte OPT_SET = 0x01;
+ // 删除本地缓存Key
+ public final static byte OPT_DEL = 0x02;
+ // 删除本地缓存
+ public final static byte OPT_REM = 0x03;
+
+ public byte oper;
+ public String name;
+ public String key;
+ public String src;
+
+ public Command() {
+ }
+
+ public Command(String src, byte oper, String name, String key) {
+ this.src = src;
+ this.oper = oper;
+ this.name = name;
+ this.key = key;
+ }
+
+ /**
+ * 更新本地缓存
+ *
+ * @param cacheName
+ * @param key
+ * @return
+ */
+ public static Command set(String src, String cacheName, String key) {
+ return new Command(src, OPT_SET, cacheName, key);
+ }
+
+ /**
+ * 删除本地缓存Key
+ *
+ * @param cacheName
+ * @param key
+ * @return
+ */
+ public static Command del(String src, String cacheName, String key) {
+ return new Command(src, OPT_DEL, cacheName, key);
+ }
+
+ /**
+ * 删除本地缓存
+ *
+ * @param cacheName
+ * @return
+ */
+ public static Command rem(String src, String cacheName) {
+ return new Command(src, OPT_REM, cacheName, null);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/irrigation/icl/cache/LayeringCacheAutoFactory.java b/src/main/java/com/irrigation/icl/cache/LayeringCacheAutoFactory.java
new file mode 100644
index 0000000..aed50d9
--- /dev/null
+++ b/src/main/java/com/irrigation/icl/cache/LayeringCacheAutoFactory.java
@@ -0,0 +1,77 @@
+package com.irrigation.icl.cache;
+
+import com.irrigation.icl.cache.config.CacheConfig;
+import com.irrigation.icl.cache.core.LayeringCacheLoadCondition;
+import com.irrigation.icl.cache.core.LayeringCacheManager;
+import com.irrigation.icl.cache.core.LayeringCacheProperties;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cache.CacheManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.Message;
+import org.springframework.data.redis.connection.MessageListener;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.listener.PatternTopic;
+import org.springframework.data.redis.listener.RedisMessageListenerContainer;
+import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
+
+/**
+ * @Author: boni
+ * @Date: 2018/8/24-下午2:37
+ */
+@Configuration
+@Conditional(LayeringCacheLoadCondition.class)
+@EnableConfigurationProperties(LayeringCacheProperties.class)
+@Slf4j
+public class LayeringCacheAutoFactory {
+ @Bean
+ public LayeringCacheManager cacheManager(RedisTemplate