forked from kidgrow-microservices-platform

zhaoxiaohao
2020-10-30 2e109492d152e08bfca445b54f15c91a2334f21c
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
package com.kidgrow.authclient.config;
 
import com.kidgrow.authclient.store.AuthDbTokenStore;
import com.kidgrow.authclient.store.AuthJwtTokenStore;
import com.kidgrow.authclient.store.AuthRedisTokenStore;
import com.kidgrow.authclient.store.ResJwtTokenStore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 *
 * @Description: Token 存储配置<br>
 * @Project: <br>
 * @CreateDate: Created in 2020/2/13 11:23 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
@Configuration
public class TokenStoreConfig {
    @Configuration
    @ConditionalOnProperty(prefix = "kidgrow.oauth2.token.store", name = "type", havingValue = "db")
    @Import(AuthDbTokenStore.class)
    public class JdbcTokenConfig {
    }
 
    @Configuration
    @ConditionalOnProperty(prefix = "kidgrow.oauth2.token.store", name = "type", havingValue = "redis", matchIfMissing = true)
    @Import(AuthRedisTokenStore.class)
    public class RedisTokenConfig {
    }
 
    @Configuration
    @ConditionalOnProperty(prefix = "kidgrow.oauth2.token.store", name = "type", havingValue = "authJwt")
    @Import(AuthJwtTokenStore.class)
    public class AuthJwtTokenConfig {
    }
 
    @Configuration
    @ConditionalOnProperty(prefix = "kidgrow.oauth2.token.store", name = "type", havingValue = "resJwt")
    @Import(ResJwtTokenStore.class)
    public class ResJwtTokenConfig {
    }
}