diff --git a/hai-cweb/src/main/java/com/CWebApplication.java b/hai-cweb/src/main/java/com/CWebApplication.java index c8b21fbc..90139afd 100644 --- a/hai-cweb/src/main/java/com/CWebApplication.java +++ b/hai-cweb/src/main/java/com/CWebApplication.java @@ -1,5 +1,7 @@ package com; +import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; +import com.alicp.jetcache.anno.config.EnableMethodCache; import com.hai.common.utils.SpringContextUtil; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; @@ -13,6 +15,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; //@ComponentScan @EnableTransactionManagement @EnableScheduling +@EnableMethodCache(basePackages = "com.hai") +@EnableCreateCacheAnnotation @ServletComponentScan @MapperScan("com.hai.dao") public class CWebApplication diff --git a/hai-cweb/src/main/resources/dev/application.yml b/hai-cweb/src/main/resources/dev/application.yml index 978d5d8d..21444cdd 100644 --- a/hai-cweb/src/main/resources/dev/application.yml +++ b/hai-cweb/src/main/resources/dev/application.yml @@ -73,6 +73,28 @@ mybatis: #开启MyBatis的二级缓存 cache-enabled: true +jetcache: + statIntervalMinutes: 15 + areaInCacheName: false + local: + default: + type: linkedhashmap + keyConvertor: fastjson + remote: + default: + type: redis + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + keyConvertor: fastjson + broadcastChannel: projectA + valueEncoder: java + valueDecoder: java + poolConfig: + minIdle: 5 + maxIdle: 20 + maxTotal: 50 + pagehelper: helperDialect: mysql reasonable: true