futian.liu
2023-12-02 8e41786892a4bd7cff2d63bde8cb0636cdb0650c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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.LocalFinOrgCache;
import com.consum.base.cache.LocalFinSysTenantCache;
import com.consum.base.cache.LocalFinSysTenantUserCache;
import com.consum.base.cache.LocalTokenCache;
import com.consum.base.service.FinOrgService;
import com.consum.base.service.FinSysTenantServiceImpl;
import com.consum.base.service.FinSysTenantUserServiceImpl;
import com.iplatform.base.config.CacheConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
@Configuration
@ConditionalOnProperty(prefix = "iplatform.cache", name = "redis-enabled", havingValue = "false", matchIfMissing = true)
public class LocalFinCacheConfig extends CacheConfiguration {
 
    /**
     * 配置业务机构缓存。
     * @param finOrgService
     * @return
     * @date 2023-07-05
     */
    @Bean
    public FinOrgCacheProvider finOrgCacheProvider(FinOrgService finOrgService){
        LocalFinOrgCache cache = new LocalFinOrgCache();
        cache.setFinOrgService(finOrgService);
        return cache;
    }
 
    /**
     * @Description 配置平台登录用户缓存
     * @Author wh
     * @Date 2023/7/18 13:36
     */
    @Bean
    public FinSysTenantUserCacheProvider finSysTenantUserCacheProvider(FinSysTenantUserServiceImpl finSysTenantUserService){
        LocalFinSysTenantUserCache cache = new LocalFinSysTenantUserCache();
        cache.setFinSysTenantUserService(finSysTenantUserService);
        return cache;
    }
 
 
    /**
     *   江南登录用户缓存
     * @return
     */
    @Bean
    public TokenCacheProvider tokenCacheProvider(){
        LocalTokenCache cache = new LocalTokenCache();
        return cache;
    }
 
    /**
     * 配置业务机构缓存。
     * @param finSysTenantService
     * @return
     * @date 2023-07-05
     */
    @Bean
    public FinSysTenantCacheProvider finSysTenantCacheProvider(FinSysTenantServiceImpl finSysTenantService){
        LocalFinSysTenantCache cache = new LocalFinSysTenantCache();
        cache.setFinSysTenantService(finSysTenantService);
        return cache;
    }
}