| | |
| | | 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; |
| | |
| | | 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; |