123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package com.care;
- import com.care.bms.mqtt.MqttInit;
- import org.mybatis.spring.annotation.MapperScan;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
- import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
- import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
- import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
- import org.springframework.context.annotation.Bean;
- import org.springframework.scheduling.annotation.EnableScheduling;
- import org.springframework.web.client.RestTemplate;
- /**
- * @author little
- */
- @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
- @EnableScheduling
- @MapperScan("com.care.**.mapper")
- public class CareSpringStart {
- public static void main(String[] args) {
- SpringApplication.run(CareSpringStart.class, args);
- }
- @Bean
- RestTemplate createTemplate(){
- return new RestTemplate();
- }
- @Bean
- public ConfigurableServletWebServerFactory webServerFactory() {
- TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
- factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "|{}[]"));
- return factory;
- }
- @Bean
- public MqttInit mqttInit() {
- return new MqttInit();
- }
- }
|