From dfd45b0998e4b9279e8ed8a33fbf82fc4e8b6015 Mon Sep 17 00:00:00 2001 From: whycxzp <glperry@163.com> Date: 星期四, 06 三月 2025 14:39:26 +0800 Subject: [PATCH] 区分默认通用,太供,晋源,代码逻辑微调 --- src/main/java/com/whyc/App.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/whyc/App.java b/src/main/java/com/whyc/App.java index 1f7faa4..8a0f75a 100644 --- a/src/main/java/com/whyc/App.java +++ b/src/main/java/com/whyc/App.java @@ -6,11 +6,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; -import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @@ -29,6 +30,12 @@ SpringApplication.run(App.class, args); } + @Bean + //閰嶇疆鍐呯殑system.subType=2鏃讹紝绔彛涓�18919 + @ConditionalOnProperty(name = "system.subType", havingValue = "2") + public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> webServerFactoryCustomizer() { + return factory -> factory.setPort(18919); + } @Value("${http.port}") private Integer httpPort; -- Gitblit v1.9.1