From d2048c247c446be08598abf8e1bc11a4ea77be32 Mon Sep 17 00:00:00 2001 From: luqingyang <lqy5492@163.com> Date: 星期三, 25 十月 2023 16:41:49 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- consum-base/src/main/java/com/consum/base/config/RedisFinCacheConfig.java | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) diff --git a/consum-base/src/main/java/com/consum/base/config/RedisFinCacheConfig.java b/consum-base/src/main/java/com/consum/base/config/RedisFinCacheConfig.java new file mode 100644 index 0000000..7bc787f --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/config/RedisFinCacheConfig.java @@ -0,0 +1,85 @@ +package com.consum.base.config; + +import com.consum.base.FinOrgCacheProvider; +import com.consum.base.FinSysTenantCacheProvider; +import com.consum.base.FinSysTenantUserCacheProvider; +import com.consum.base.TokenCacheProvider; +import com.consum.base.cache.RedisFinOrgCache; +import com.consum.base.cache.RedisFinSysTenantCache; +import com.consum.base.cache.RedisFinSysTenantUserCache; +import com.consum.base.cache.RedisTokenCache; +import com.consum.base.service.FinOrgServiceImpl; +import com.consum.base.service.FinSysTenantServiceImpl; +import com.consum.base.service.FinSysTenantUserServiceImpl; +import com.iplatform.base.config.CacheConfiguration; +import com.walker.support.redis.RedisHelper; +import com.walker.support.redis.cache.RedisCacheProvider; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConditionalOnProperty(prefix = "iplatform.cache", name = "redis-enabled", havingValue = "true", matchIfMissing = false) +@ConditionalOnClass({RedisCacheProvider.class}) +@AutoConfigureAfter(RedisAutoConfiguration.class) +public class RedisFinCacheConfig extends CacheConfiguration { + + /** + * Redis瀹炵幇鐨勪笟鍔℃満鏋勭紦瀛橀厤缃�� + * @param redisHelper + * @param finOrgService + * @return + * @date 2023-07-05 + */ + @Bean + public FinOrgCacheProvider finOrgCacheProvider(RedisHelper redisHelper, FinOrgServiceImpl finOrgService){ + RedisFinOrgCache cache = new RedisFinOrgCache(); + cache.setRedisHelper(redisHelper); + cache.setFinOrgService(finOrgService); + return cache; + } + + /** + * @Description 閰嶇疆骞冲彴鐧诲綍鐢ㄦ埛缂撳瓨 + * @Author wh + * @Date 2023/7/18 13:38 + */ + @Bean + public FinSysTenantUserCacheProvider finSysTenantUserCacheProvider(RedisHelper redisHelper, FinSysTenantUserServiceImpl finSysTenantUserService){ + RedisFinSysTenantUserCache cache = new RedisFinSysTenantUserCache(); + cache.setRedisHelper(redisHelper); + cache.setFinSysTenantUserService(finSysTenantUserService); + return cache; + } + + /** + * @Description 閰嶇疆骞冲彴鐧诲綍鐢ㄦ埛缂撳瓨 + * @Author wh + * @Date 2023/7/18 13:38 + */ + @Bean + public TokenCacheProvider tokenCacheProvider(RedisHelper redisHelper){ + RedisTokenCache cache = new RedisTokenCache(); + cache.setRedisHelper(redisHelper); + return cache; + } + + /** + * Redis瀹炵幇鐨勪笟鍔℃満鏋勭紦瀛橀厤缃�� + * @param redisHelper + * @param finSysTenantService + * @return + * @date 2023-07-05 + */ + @Bean + public FinSysTenantCacheProvider finSysTenantCacheProvider(RedisHelper redisHelper, FinSysTenantServiceImpl finSysTenantService){ + RedisFinSysTenantCache cache = new RedisFinSysTenantCache(); + cache.setRedisHelper(redisHelper); + cache.setFinSysTenantService(finSysTenantService); + return cache; + } + +} -- Gitblit v1.9.1