mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-28 23:31:26 +08:00
update 升级 springboot 2.7.2 重构使用最新自动配置方式
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
package com.ruoyi.common.web.config;
|
||||
|
||||
import com.ruoyi.common.web.core.I18nLocaleResolver;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.LocaleResolver;
|
||||
|
||||
/**
|
||||
@@ -12,8 +11,7 @@ import org.springframework.web.servlet.LocaleResolver;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfigureBefore(WebMvcAutoConfiguration.class)
|
||||
@AutoConfiguration(before = WebMvcAutoConfiguration.class)
|
||||
public class I18nConfig {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -7,25 +7,24 @@ import com.alibaba.cloud.nacos.discovery.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientConfiguration;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosWatch;
|
||||
import com.ruoyi.common.web.nacos.CustomNacosWatch;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.client.ConditionalOnBlockingDiscoveryEnabled;
|
||||
import org.springframework.cloud.client.ConditionalOnDiscoveryEnabled;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 自定义 nacos 监听 解决与 Undertow 整合报错问题
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration(
|
||||
before = NacosDiscoveryClientConfiguration.class,
|
||||
after = NacosDiscoveryAutoConfiguration.class
|
||||
)
|
||||
@ConditionalOnDiscoveryEnabled
|
||||
@ConditionalOnBlockingDiscoveryEnabled
|
||||
@ConditionalOnNacosDiscoveryEnabled
|
||||
@AutoConfigureBefore(NacosDiscoveryClientConfiguration.class)
|
||||
@AutoConfigureAfter(NacosDiscoveryAutoConfiguration.class)
|
||||
public class NacosConfig {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -2,16 +2,16 @@ package com.ruoyi.common.web.config;
|
||||
|
||||
import io.undertow.server.DefaultByteBufferPool;
|
||||
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Undertow 自定义配置
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@AutoConfiguration
|
||||
public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.ruoyi.common.web.config.I18nConfig,\
|
||||
com.ruoyi.common.web.config.UndertowConfig,\
|
||||
com.ruoyi.common.web.config.NacosConfig
|
||||
@@ -0,0 +1,3 @@
|
||||
com.ruoyi.common.web.config.I18nConfig
|
||||
com.ruoyi.common.web.config.UndertowConfig
|
||||
com.ruoyi.common.web.config.NacosConfig
|
||||
Reference in New Issue
Block a user