Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
microservices-platform
提交
cf63212f
microservices-platform
项目概览
zhangjian1949
/
microservices-platform
与 Fork 源项目一致
Fork自
zlt2000 / microservices-platform
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
microservices-platform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cf63212f
编写于
3月 24, 2020
作者:
zlt2000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化公共starter的bean加载方式,避免依赖的工程因包路径不一致而导致加载不了的情况
上级
5ab0d63c
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
24 addition
and
65 deletion
+24
-65
zlt-business/search-center/search-client/src/main/java/com/central/search/annotation/EnableSearchClient.java
...ava/com/central/search/annotation/EnableSearchClient.java
+3
-2
zlt-business/search-center/search-client/src/main/java/com/central/search/client/feign/fallback/SearchServiceFallbackFactory.java
...h/client/feign/fallback/SearchServiceFallbackFactory.java
+0
-2
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/config/TokenStoreConfig.java
...va/com/central/oauth2/common/config/TokenStoreConfig.java
+0
-38
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthDbTokenStore.java
...ava/com/central/oauth2/common/store/AuthDbTokenStore.java
+2
-1
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthJwtTokenStore.java
...va/com/central/oauth2/common/store/AuthJwtTokenStore.java
+2
-0
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java
.../com/central/oauth2/common/store/AuthRedisTokenStore.java
+2
-0
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/ResJwtTokenStore.java
...ava/com/central/oauth2/common/store/ResJwtTokenStore.java
+2
-0
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/resources/META-INF/spring.factories
...boot-starter/src/main/resources/META-INF/spring.factories
+5
-1
zlt-commons/zlt-common-core/src/main/java/com/central/common/feign/fallback/UserServiceFallbackFactory.java
...ral/common/feign/fallback/UserServiceFallbackFactory.java
+0
-2
zlt-commons/zlt-common-core/src/main/resources/META-INF/spring.factories
...-common-core/src/main/resources/META-INF/spring.factories
+4
-1
zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java
...ain/java/com/central/common/redis/RedisAutoConfigure.java
+0
-13
zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/lock/RedisDistributedLock.java
...a/com/central/common/redis/lock/RedisDistributedLock.java
+0
-1
zlt-commons/zlt-redis-spring-boot-starter/src/main/resources/META-INF/spring.factories
...boot-starter/src/main/resources/META-INF/spring.factories
+3
-1
zlt-commons/zlt-swagger2-spring-boot-starter/src/main/java/com/central/common/swagger2/Swagger2Configuration.java
...va/com/central/common/swagger2/Swagger2Configuration.java
+0
-2
zlt-config/src/main/resources/application-dev.properties
zlt-config/src/main/resources/application-dev.properties
+1
-1
未找到文件。
zlt-business/search-center/search-client/src/main/java/com/central/search/annotation/EnableSearchClient.java
浏览文件 @
cf63212f
package
com.central.search.annotation
;
import
com.central.search.client.feign.fallback.SearchServiceFallbackFactory
;
import
com.central.search.client.service.impl.QueryServiceImpl
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Import
;
...
...
@@ -16,8 +17,8 @@ import java.lang.annotation.Target;
*/
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@EnableFeignClients
@Import
(
QueryServiceImpl
.
class
)
@EnableFeignClients
(
basePackages
=
"com.central"
)
@Import
(
{
SearchServiceFallbackFactory
.
class
,
QueryServiceImpl
.
class
}
)
public
@interface
EnableSearchClient
{
}
zlt-business/search-center/search-client/src/main/java/com/central/search/client/feign/fallback/SearchServiceFallbackFactory.java
浏览文件 @
cf63212f
...
...
@@ -5,7 +5,6 @@ import com.central.common.model.PageResult;
import
com.central.search.client.feign.SearchService
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
/**
* searchService降级工场
...
...
@@ -13,7 +12,6 @@ import org.springframework.stereotype.Component;
* @author zlt
*/
@Slf4j
@Component
public
class
SearchServiceFallbackFactory
implements
FallbackFactory
<
SearchService
>
{
@Override
public
SearchService
create
(
Throwable
throwable
)
{
...
...
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/config/TokenStoreConfig.java
已删除
100644 → 0
浏览文件 @
5ab0d63c
package
com.central.oauth2.common.config
;
import
com.central.oauth2.common.store.*
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
/**
* token存储配置
*
* @author zlt
*/
@Configuration
public
class
TokenStoreConfig
{
@Configuration
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"db"
)
@Import
(
AuthDbTokenStore
.
class
)
public
class
JdbcTokenConfig
{
}
@Configuration
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"redis"
,
matchIfMissing
=
true
)
@Import
(
AuthRedisTokenStore
.
class
)
public
class
RedisTokenConfig
{
}
@Configuration
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"authJwt"
)
@Import
(
AuthJwtTokenStore
.
class
)
public
class
AuthJwtTokenConfig
{
}
@Configuration
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"resJwt"
)
@Import
(
ResJwtTokenStore
.
class
)
public
class
ResJwtTokenConfig
{
}
}
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthDbTokenStore.java
浏览文件 @
cf63212f
package
com.central.oauth2.common.store
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
import
org.springframework.security.oauth2.provider.token.store.JdbcTokenStore
;
...
...
@@ -13,8 +14,8 @@ import javax.sql.DataSource;
* @author zlt
* @date 2018/7/24 16:23
*/
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"db"
)
public
class
AuthDbTokenStore
{
@Autowired
private
DataSource
dataSource
;
...
...
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthJwtTokenStore.java
浏览文件 @
cf63212f
...
...
@@ -2,6 +2,7 @@ package com.central.oauth2.common.store;
import
com.central.common.model.SysUser
;
import
com.central.oauth2.common.converter.CustomUserAuthenticationConverter
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.cloud.bootstrap.encrypt.KeyProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.security.oauth2.common.DefaultOAuth2AccessToken
;
...
...
@@ -23,6 +24,7 @@ import java.util.Map;
* @author zlt
* @date 2018/7/24 16:21
*/
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"authJwt"
)
public
class
AuthJwtTokenStore
{
@Bean
(
"keyProp"
)
...
...
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/AuthRedisTokenStore.java
浏览文件 @
cf63212f
...
...
@@ -2,6 +2,7 @@ package com.central.oauth2.common.store;
import
com.central.oauth2.common.properties.SecurityProperties
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.security.oauth2.provider.token.TokenStore
;
...
...
@@ -13,6 +14,7 @@ import org.springframework.security.oauth2.provider.token.TokenStore;
* @author zlt
* @date 2018/7/25 9:36
*/
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"redis"
,
matchIfMissing
=
true
)
public
class
AuthRedisTokenStore
{
@Autowired
private
RedisConnectionFactory
connectionFactory
;
...
...
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/java/com/central/oauth2/common/store/ResJwtTokenStore.java
浏览文件 @
cf63212f
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
import
com.central.common.constant.SecurityConstants
;
import
com.central.oauth2.common.converter.CustomUserAuthenticationConverter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.core.io.ClassPathResource
;
...
...
@@ -30,6 +31,7 @@ import java.util.stream.Collectors;
* @author zlt
* @date 2018/8/20 9:25
*/
@ConditionalOnProperty
(
prefix
=
"zlt.oauth2.token.store"
,
name
=
"type"
,
havingValue
=
"resJwt"
)
public
class
ResJwtTokenStore
{
@Autowired
private
ResourceServerProperties
resource
;
...
...
zlt-commons/zlt-auth-client-spring-boot-starter/src/main/resources/META-INF/spring.factories
浏览文件 @
cf63212f
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.central.oauth2.common.config.SecurityPropertiesConfig
\ No newline at end of file
com.central.oauth2.common.config.SecurityPropertiesConfig,\
com.central.oauth2.common.store.AuthDbTokenStore,\
com.central.oauth2.common.store.AuthRedisTokenStore,\
com.central.oauth2.common.store.AuthJwtTokenStore,\
com.central.oauth2.common.store.ResJwtTokenStore
\ No newline at end of file
zlt-commons/zlt-common-core/src/main/java/com/central/common/feign/fallback/UserServiceFallbackFactory.java
浏览文件 @
cf63212f
...
...
@@ -5,7 +5,6 @@ import com.central.common.model.LoginAppUser;
import
com.central.common.model.SysUser
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
/**
* userService降级工场
...
...
@@ -14,7 +13,6 @@ import org.springframework.stereotype.Component;
* @date 2019/1/18
*/
@Slf4j
@Component
public
class
UserServiceFallbackFactory
implements
FallbackFactory
<
UserService
>
{
@Override
public
UserService
create
(
Throwable
throwable
)
{
...
...
zlt-commons/zlt-common-core/src/main/resources/META-INF/spring.factories
浏览文件 @
cf63212f
org.springframework.context.ApplicationContextInitializer=\
com.central.common.config.BannerInitializer
\ No newline at end of file
com.central.common.config.BannerInitializer
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.central.common.feign.fallback.UserServiceFallbackFactory
\ No newline at end of file
zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/RedisAutoConfigure.java
浏览文件 @
cf63212f
...
...
@@ -5,7 +5,6 @@ import com.central.common.redis.template.RedisRepository;
import
com.central.common.redis.util.RedisObjectSerializer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.interceptor.KeyGenerator
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.data.redis.RedisProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
...
...
@@ -53,18 +52,6 @@ public class RedisAutoConfigure {
return
redisTemplate
;
}
/**
* Redis repository redis repository.
*
* @param redisTemplate the redis template
* @return the redis repository
*/
@Bean
@ConditionalOnMissingBean
public
RedisRepository
redisRepository
(
RedisTemplate
<
String
,
Object
>
redisTemplate
)
{
return
new
RedisRepository
(
redisTemplate
);
}
@Bean
(
name
=
"cacheManager"
)
@Primary
public
CacheManager
cacheManager
(
RedisConnectionFactory
redisConnectionFactory
)
{
...
...
zlt-commons/zlt-redis-spring-boot-starter/src/main/java/com/central/common/redis/lock/RedisDistributedLock.java
浏览文件 @
cf63212f
...
...
@@ -20,7 +20,6 @@ import java.util.concurrent.TimeUnit;
* @date 2018/5/29 14:16
*/
@Slf4j
@Component
public
class
RedisDistributedLock
extends
AbstractDistributedLock
{
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
...
...
zlt-commons/zlt-redis-spring-boot-starter/src/main/resources/META-INF/spring.factories
浏览文件 @
cf63212f
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.central.common.redis.RedisAutoConfigure
com.central.common.redis.RedisAutoConfigure,\
com.central.common.redis.lock.RedisDistributedLock,\
com.central.common.redis.template.RedisRepository
\ No newline at end of file
zlt-commons/zlt-swagger2-spring-boot-starter/src/main/java/com/central/common/swagger2/Swagger2Configuration.java
浏览文件 @
cf63212f
package
com.central.common.swagger2
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration
;
...
...
@@ -10,7 +9,6 @@ import springfox.documentation.swagger2.configuration.Swagger2DocumentationConfi
* @author zlt
* @date 2018/11/18 9:20
*/
@Configuration
@ConditionalOnProperty
(
name
=
"zlt.swagger.enabled"
,
matchIfMissing
=
true
)
@Import
({
Swagger2DocumentationConfiguration
.
class
...
...
zlt-config/src/main/resources/application-dev.properties
浏览文件 @
cf63212f
...
...
@@ -11,7 +11,7 @@ spring.redis.timeout=5000
##### elasticsearch配置
zlt.elasticsearch.cluster-name
=
my-es
zlt.elasticsearch.cluster-nodes
=
1
92.168.28.130
zlt.elasticsearch.cluster-nodes
=
1
06.12.138.245
##### sentinel配置
zlt.sentinel.dashboard
=
192.168.28.130:6999
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录