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/README.md b/README.md
index 2bb478f..553795b 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,32 @@
-sass-common-lib:公共项目库
+## sass-common-lib:公共项目库
+
+### v 1.2.0版本更新记录
+- 利用redis和ehcache增加了缓存支持,redis为L2级缓存,ehcache为L1级cache;
+> application.yml基本配置如下:
+```json
+#开启ehcache和redis两级缓存
+springext:
+ cache:
+ enable: true
+ cacheL1:
+ enable: true
+ topic: cache #同步L1缓存的topic
+ key: "keys"
+```
+```json
+#redis配置
+spring:
+ redis:
+ database: 10
+ host: 192.168.2.252
+ port: 6379
+# password: zhnf@123
+ pool:
+ max-wait: 1
+```
+
+### v1.2.1
+- 增加了KeyGenerator实现类,实现类中使用className.methodName:params拼接成key
+
+### v1.2.2
+- 增加了对@CacheEvict(allEntries = true)的支持
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 29e76e5..d8bd51a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,19 +6,22 @@
com.irrigation
common-lib
- 1.0-SNAPSHOT
+ 1.2.4
UTF-8
1.8
+ 1.5.10.RELEASE
2.7.0
1.16.20
1.11
20.0
1.7.24
- 1.2.46
+ 1.2.49
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..e8dcbb1
--- /dev/null
+++ b/src/main/java/com/irrigation/icl/cache/LayeringCacheAutoFactory.java
@@ -0,0 +1,78 @@
+package com.irrigation.icl.cache;
+
+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.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