mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 01:01:52 +08:00
feat: 适配springboot 2.7 configuration ==> AutoConfiguration
This commit is contained in:
parent
1aa05e0198
commit
283aae1da2
@ -1,15 +1,15 @@
|
|||||||
package cn.iocoder.yudao.framework.banner.config;
|
package cn.iocoder.yudao.framework.banner.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.banner.core.BannerApplicationRunner;
|
import cn.iocoder.yudao.framework.banner.core.BannerApplicationRunner;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Banner 的自动配置类
|
* Banner 的自动配置类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoBannerAutoConfiguration {
|
public class YudaoBannerAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -7,8 +7,8 @@ import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRuleFac
|
|||||||
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRuleFactoryImpl;
|
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRuleFactoryImpl;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoDataPermissionAutoConfiguration {
|
public class YudaoDataPermissionAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissi
|
|||||||
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
|
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@ConditionalOnClass(LoginUser.class)
|
@ConditionalOnClass(LoginUser.class)
|
||||||
@ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class})
|
@ConditionalOnBean(value = {PermissionApi.class, DeptDataPermissionRuleCustomizer.class})
|
||||||
public class YudaoDeptDataPermissionAutoConfiguration {
|
public class YudaoDeptDataPermissionAutoConfiguration {
|
||||||
|
@ -2,10 +2,10 @@ package cn.iocoder.yudao.framework.dict.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
|
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoDictAutoConfiguration {
|
public class YudaoDictAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -6,10 +6,10 @@ import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoader;
|
|||||||
import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoaderImpl;
|
import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoaderImpl;
|
||||||
import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi;
|
import cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,7 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志
|
@ConditionalOnProperty(prefix = "yudao.error-code", value = "enable", matchIfMissing = true) // 允许使用 yudao.error-code.enable=false 禁用访问日志
|
||||||
@EnableConfigurationProperties(ErrorCodeProperties.class)
|
@EnableConfigurationProperties(ErrorCodeProperties.class)
|
||||||
@EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码
|
@EnableScheduling // 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码
|
||||||
|
@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.operatelog.core.aop.OperateLogAspect;
|
|||||||
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService;
|
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkServiceImpl;
|
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkServiceImpl;
|
||||||
import cn.iocoder.yudao.module.system.api.logger.OperateLogApi;
|
import cn.iocoder.yudao.module.system.api.logger.OperateLogApi;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoOperateLogAutoConfiguration {
|
public class YudaoOperateLogAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -2,16 +2,16 @@ package cn.iocoder.yudao.framework.pay.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
|
import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
|
||||||
import cn.iocoder.yudao.framework.pay.core.client.impl.PayClientFactoryImpl;
|
import cn.iocoder.yudao.framework.pay.core.client.impl.PayClientFactoryImpl;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付配置类
|
* 支付配置类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties(PayProperties.class)
|
@EnableConfigurationProperties(PayProperties.class)
|
||||||
public class YudaoPayAutoConfiguration {
|
public class YudaoPayAutoConfiguration {
|
||||||
|
|
||||||
|
@ -2,15 +2,15 @@ package cn.iocoder.yudao.framework.sms.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory;
|
import cn.iocoder.yudao.framework.sms.core.client.SmsClientFactory;
|
||||||
import cn.iocoder.yudao.framework.sms.core.client.impl.SmsClientFactoryImpl;
|
import cn.iocoder.yudao.framework.sms.core.client.impl.SmsClientFactoryImpl;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信配置类
|
* 短信配置类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoSmsAutoConfiguration {
|
public class YudaoSmsAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -6,10 +6,10 @@ import com.xkcoding.http.support.hutool.HutoolImpl;
|
|||||||
import com.xkcoding.justauth.autoconfigure.JustAuthProperties;
|
import com.xkcoding.justauth.autoconfigure.JustAuthProperties;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.zhyd.oauth.cache.AuthStateCache;
|
import me.zhyd.oauth.cache.AuthStateCache;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,7 +19,7 @@ import org.springframework.context.annotation.Primary;
|
|||||||
* @date 2021-10-30
|
* @date 2021-10-30
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties(JustAuthProperties.class)
|
@EnableConfigurationProperties(JustAuthProperties.class)
|
||||||
public class YudaoSocialAutoConfiguration {
|
public class YudaoSocialAutoConfiguration {
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||||
@ -35,7 +35,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) // 允许使用 yudao.tenant.enable=false 禁用多租户
|
@ConditionalOnProperty(prefix = "yudao.tenant", value = "enable", matchIfMissing = true) // 允许使用 yudao.tenant.enable=false 禁用多租户
|
||||||
@EnableConfigurationProperties(TenantProperties.class)
|
@EnableConfigurationProperties(TenantProperties.class)
|
||||||
public class YudaoTenantAutoConfiguration {
|
public class YudaoTenantAutoConfiguration {
|
||||||
|
@ -4,11 +4,11 @@ import cn.hutool.core.util.ClassUtil;
|
|||||||
import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants;
|
import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants;
|
||||||
import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl;
|
import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl;
|
||||||
import com.anji.captcha.service.CaptchaCacheService;
|
import com.anji.captcha.service.CaptchaCacheService;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoCaptchaConfiguration {
|
public class YudaoCaptchaConfiguration {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -2,15 +2,15 @@ package cn.iocoder.yudao.framework.file.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.file.core.client.FileClientFactory;
|
import cn.iocoder.yudao.framework.file.core.client.FileClientFactory;
|
||||||
import cn.iocoder.yudao.framework.file.core.client.FileClientFactoryImpl;
|
import cn.iocoder.yudao.framework.file.core.client.FileClientFactoryImpl;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件配置类
|
* 文件配置类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoFileAutoConfiguration {
|
public class YudaoFileAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -2,13 +2,13 @@ package cn.iocoder.yudao.framework.flowable.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
||||||
import cn.iocoder.yudao.framework.flowable.core.web.FlowableWebFilter;
|
import cn.iocoder.yudao.framework.flowable.core.web.FlowableWebFilter;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.core.task.AsyncListenableTaskExecutor;
|
import org.springframework.core.task.AsyncListenableTaskExecutor;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoFlowableConfiguration {
|
public class YudaoFlowableConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,15 +3,15 @@ package cn.iocoder.yudao.framework.quartz.config;
|
|||||||
import com.alibaba.ttl.TtlRunnable;
|
import com.alibaba.ttl.TtlRunnable;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步任务 Configuration
|
* 异步任务 Configuration
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
public class YudaoAsyncAutoConfiguration {
|
public class YudaoAsyncAutoConfiguration {
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@ package cn.iocoder.yudao.framework.quartz.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager;
|
import cn.iocoder.yudao.framework.quartz.core.scheduler.SchedulerManager;
|
||||||
import org.quartz.Scheduler;
|
import org.quartz.Scheduler;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务 Configuration
|
* 定时任务 Configuration
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableScheduling // 开启 Spring 自带的定时任务
|
@EnableScheduling // 开启 Spring 自带的定时任务
|
||||||
public class YudaoQuartzAutoConfiguration {
|
public class YudaoQuartzAutoConfiguration {
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@ package cn.iocoder.yudao.framework.tracer.config;
|
|||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
|
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metrics 配置类
|
* Metrics 配置类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@ConditionalOnClass({MeterRegistryCustomizer.class})
|
@ConditionalOnClass({MeterRegistryCustomizer.class})
|
||||||
@ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics
|
@ConditionalOnProperty(prefix = "yudao.metrics", value = "enable", matchIfMissing = true) // 允许使用 yudao.metrics.enable=false 禁用 Metrics
|
||||||
public class YudaoMetricsAutoConfiguration {
|
public class YudaoMetricsAutoConfiguration {
|
||||||
|
@ -3,19 +3,19 @@ package cn.iocoder.yudao.framework.tracer.config;
|
|||||||
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum;
|
||||||
import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect;
|
import cn.iocoder.yudao.framework.tracer.core.aop.BizTraceAspect;
|
||||||
import cn.iocoder.yudao.framework.tracer.core.filter.TraceFilter;
|
import cn.iocoder.yudao.framework.tracer.core.filter.TraceFilter;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracer 配置类
|
* Tracer 配置类
|
||||||
*
|
*
|
||||||
* @author mashu
|
* @author mashu
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@ConditionalOnClass({BizTraceAspect.class})
|
@ConditionalOnClass({BizTraceAspect.class})
|
||||||
@EnableConfigurationProperties(TracerProperties.class)
|
@EnableConfigurationProperties(TracerProperties.class)
|
||||||
@ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true)
|
@ConditionalOnProperty(prefix = "yudao.tracer", value = "enable", matchIfMissing = true)
|
||||||
|
@ -10,9 +10,8 @@ import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener;
|
|||||||
import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener;
|
import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener;
|
||||||
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
|
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||||
import org.springframework.data.redis.connection.stream.Consumer;
|
import org.springframework.data.redis.connection.stream.Consumer;
|
||||||
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
import org.springframework.data.redis.connection.stream.ObjectRecord;
|
||||||
@ -35,9 +34,8 @@ import java.util.Properties;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
|
||||||
@AutoConfigureAfter(YudaoRedisAutoConfiguration.class)
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@AutoConfiguration(after = YudaoRedisAutoConfiguration.class)
|
||||||
public class YudaoMQAutoConfiguration {
|
public class YudaoMQAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -2,11 +2,11 @@ package cn.iocoder.yudao.framework.datasource.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.datasource.core.filter.DruidAdRemoveFilter;
|
import cn.iocoder.yudao.framework.datasource.core.filter.DruidAdRemoveFilter;
|
||||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理
|
@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理
|
||||||
@EnableConfigurationProperties(DruidStatProperties.class)
|
@EnableConfigurationProperties(DruidStatProperties.class)
|
||||||
public class YudaoDataSourceAutoConfiguration {
|
public class YudaoDataSourceAutoConfiguration {
|
||||||
|
@ -13,9 +13,9 @@ import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.core.env.ConfigurableEnvironment;
|
import org.springframework.core.env.ConfigurableEnvironment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,7 +23,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class,
|
@MapperScan(value = "${yudao.info.base-package}", annotationClass = Mapper.class,
|
||||||
lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试
|
lazyInitialization = "${mybatis.lazy-initialization:false}") // Mapper 懒加载,目前仅用于单元测试
|
||||||
public class YudaoMybatisAutoConfiguration {
|
public class YudaoMybatisAutoConfiguration {
|
||||||
|
@ -5,16 +5,14 @@ import cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl.DefaultIdempo
|
|||||||
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl.ExpressionIdempotentKeyResolver;
|
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl.ExpressionIdempotentKeyResolver;
|
||||||
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver;
|
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.IdempotentKeyResolver;
|
||||||
import cn.iocoder.yudao.framework.idempotent.core.redis.IdempotentRedisDAO;
|
import cn.iocoder.yudao.framework.idempotent.core.redis.IdempotentRedisDAO;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
|
import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration(after = YudaoRedisAutoConfiguration.class)
|
||||||
@AutoConfigureAfter(YudaoRedisAutoConfiguration.class)
|
|
||||||
public class YudaoIdempotentConfiguration {
|
public class YudaoIdempotentConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -4,12 +4,10 @@ import cn.hutool.core.util.ClassUtil;
|
|||||||
import com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration;
|
import com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration;
|
||||||
import cn.iocoder.yudao.framework.lock4j.core.DefaultLockFailureStrategy;
|
import cn.iocoder.yudao.framework.lock4j.core.DefaultLockFailureStrategy;
|
||||||
import cn.iocoder.yudao.framework.lock4j.core.Lock4jRedisKeyConstants;
|
import cn.iocoder.yudao.framework.lock4j.core.Lock4jRedisKeyConstants;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration(before = LockAutoConfiguration.class)
|
||||||
@AutoConfigureBefore(LockAutoConfiguration.class)
|
|
||||||
public class YudaoLock4jConfiguration {
|
public class YudaoLock4jConfiguration {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package cn.iocoder.yudao.framework.redis.config;
|
package cn.iocoder.yudao.framework.redis.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.cache.CacheProperties;
|
import org.springframework.boot.autoconfigure.cache.CacheProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||||
@ -13,7 +13,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
/**
|
/**
|
||||||
* Cache 配置类,基于 Redis 实现
|
* Cache 配置类,基于 Redis 实现
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties({CacheProperties.class})
|
@EnableConfigurationProperties({CacheProperties.class})
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
public class YudaoCacheAutoConfiguration {
|
public class YudaoCacheAutoConfiguration {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cn.iocoder.yudao.framework.redis.config;
|
package cn.iocoder.yudao.framework.redis.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||||
@ -9,7 +9,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
/**
|
/**
|
||||||
* Redis 配置类
|
* Redis 配置类
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
public class YudaoRedisAutoConfiguration {
|
public class YudaoRedisAutoConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,9 +11,9 @@ import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
|||||||
import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
|
import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
|
||||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||||
import org.springframework.beans.factory.config.MethodInvokingFactoryBean;
|
import org.springframework.beans.factory.config.MethodInvokingFactoryBean;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
@ -30,7 +30,7 @@ import javax.annotation.Resource;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties(SecurityProperties.class)
|
@EnableConfigurationProperties(SecurityProperties.class)
|
||||||
public class YudaoSecurityAutoConfiguration {
|
public class YudaoSecurityAutoConfiguration {
|
||||||
|
|
||||||
|
@ -4,10 +4,10 @@ import cn.iocoder.yudao.framework.security.core.filter.TokenAuthenticationFilter
|
|||||||
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
@ -32,7 +32,7 @@ import java.util.Set;
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||||
public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
|
public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
@ -11,16 +11,14 @@ import cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration;
|
|||||||
import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi;
|
import cn.iocoder.yudao.module.infra.api.logger.ApiAccessLogApi;
|
||||||
import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi;
|
import cn.iocoder.yudao.module.infra.api.logger.ApiErrorLogApi;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import javax.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration(after = YudaoWebAutoConfiguration.class)
|
||||||
@AutoConfigureAfter(YudaoWebAutoConfiguration.class)
|
|
||||||
public class YudaoApiLogAutoConfiguration {
|
public class YudaoApiLogAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
@ -8,12 +8,12 @@ import com.fasterxml.jackson.databind.module.SimpleModule;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class YudaoJacksonAutoConfiguration {
|
public class YudaoJacksonAutoConfiguration {
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ package cn.iocoder.yudao.framework.swagger.config;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor;
|
import cn.iocoder.yudao.framework.swagger.core.SpringFoxHandlerProviderBeanPostProcessor;
|
||||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
import springfox.documentation.builders.ExampleBuilder;
|
import springfox.documentation.builders.ExampleBuilder;
|
||||||
@ -29,7 +29,7 @@ import static springfox.documentation.builders.RequestHandlerSelectors.basePacka
|
|||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
@EnableKnife4j
|
@EnableKnife4j
|
||||||
@ConditionalOnClass({Docket.class, ApiInfoBuilder.class})
|
@ConditionalOnClass({Docket.class, ApiInfoBuilder.class})
|
||||||
|
@ -9,11 +9,11 @@ import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
|
|||||||
import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler;
|
import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler;
|
||||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.util.AntPathMatcher;
|
import org.springframework.util.AntPathMatcher;
|
||||||
import org.springframework.util.PathMatcher;
|
import org.springframework.util.PathMatcher;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -26,7 +26,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.Filter;
|
import javax.servlet.Filter;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@AutoConfiguration
|
||||||
@EnableConfigurationProperties({WebProperties.class, XssProperties.class})
|
@EnableConfigurationProperties({WebProperties.class, XssProperties.class})
|
||||||
public class YudaoWebAutoConfiguration implements WebMvcConfigurer {
|
public class YudaoWebAutoConfiguration implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user