From 5397b66b1a8454f3cd714196ac63feaf0ec773b9 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 13 Sep 2022 17:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/CWebApplication.java | 4 ++++ .../src/main/resources/dev/application.yml | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) 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