feat: 修改property加载方式

This commit is contained in:
zlt2000
2023-11-25 10:57:08 +08:00
parent cb77754ca2
commit c91f01aea1
14 changed files with 0 additions and 27 deletions
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* @author zlt
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.security")
@RefreshScope
@Component
public class SecurityProperties {
private AuthProperties auth = new AuthProperties();
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* Token配置
@@ -20,7 +19,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.oauth2.token.store")
@RefreshScope
@Component
public class TokenStoreProperties {
/**
* token存储类型(redis/db/authJwt/resJwt)
@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.ImmutableSet;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.HashSet;
@@ -17,7 +16,6 @@ import java.util.Set;
*/
@ConfigurationProperties(prefix = "zlt.datascope")
@Data
@Component
public class DataScopeProperties {
private static final Set<String> INGORE_SQL_ID = ImmutableSet
.of("com.central.user.mapper.findRolesByUserId"
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@@ -18,7 +17,6 @@ import java.util.List;
@Getter
@ConfigurationProperties(prefix = "zlt.tenant")
@RefreshScope
@Component
public class TenantProperties {
/**
* 是否开启多租户
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* mybatis-plus 配置
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.mybatis-plus.auto-fill")
@RefreshScope
@Component
public class MybatisPlusAutoFillProperties {
/**
* 是否开启自动填充字段
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* es的httpClient连接池配置
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.elasticsearch.rest-pool")
@RefreshScope
@Component
public class RestClientPoolProperties {
/**
* 链接建立超时时间
@@ -3,7 +3,6 @@ package com.central.common.lb.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* RestTemplate 配置
@@ -17,7 +16,6 @@ import org.springframework.stereotype.Component;
@Setter
@Getter
@ConfigurationProperties(prefix = "zlt.rest-template")
@Component
public class RestTemplateProperties {
/**
* 最大链接数
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* 审计日志配置
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.audit-log")
@RefreshScope
@Component
public class AuditLogProperties {
/**
* 是否开启审计日志
@@ -5,7 +5,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* 日志数据源配置
@@ -21,6 +20,5 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.audit-log.datasource")
@ConditionalOnClass(HikariConfig.class)
@Component
public class LogDbProperties extends HikariConfig {
}
@@ -4,7 +4,6 @@ import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
* 日志链路追踪配置
@@ -16,7 +15,6 @@ import org.springframework.stereotype.Component;
@Getter
@ConfigurationProperties(prefix = "zlt.trace")
@RefreshScope
@Component
public class TraceProperties {
/**
* 是否开启日志链路追踪
@@ -3,7 +3,6 @@ package com.central.oss.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author zlt
@@ -3,7 +3,6 @@ package com.central.common.redis.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
@@ -14,7 +13,6 @@ import java.util.List;
@Setter
@Getter
@ConfigurationProperties(prefix = "zlt.cache-manager")
@Component
public class CacheManagerProperties {
private List<CacheConfig> configs;
@@ -3,7 +3,6 @@ package com.central.common.zookeeper.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* zookeeper配置
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Component;
@Setter
@Getter
@ConfigurationProperties(prefix = "zlt.zookeeper")
@Component
public class ZookeeperProperty {
/**
* zk连接集群,多个用逗号隔开