// Path: src/main/java/org/myazure/weixin/configuration/AppUrlService.java
// public class AppUrlService {
// 
//     @Value("${myazure.appUrl}")
//     private String appUrl;
// 
//     public AppUrlService() {
// 
//     }
// 
//     public void setAppUrl(String appUrl) {
//         this.appUrl = appUrl;
//     }
// 
//     public String getAppUrl() {
//         return appUrl;
//     }
// }
// 
// Path: src/main/java/org/myazure/weixin/configuration/MyazureEmbeddedServletContainerCustomizer.java
// public class MyazureEmbeddedServletContainerCustomizer implements EmbeddedServletContainerCustomizer {
// 
// 	private static final Logger LOG = LoggerFactory.getLogger(MyazureEmbeddedServletContainerCustomizer.class);
// 
// 	@Value("${servlet.container.maxThreads}")
// 	private int MAX_THREADS;
// 
// 	@Override
// 	public void customize(ConfigurableEmbeddedServletContainer factory) {
// 		if (factory instanceof TomcatEmbeddedServletContainerFactory) {
// 			customizeTomcat((TomcatEmbeddedServletContainerFactory) factory);
// 		}
// 	}
// 
// 	public void customizeTomcat(TomcatEmbeddedServletContainerFactory factory) {
// 		factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
// 			@Override
// 			public void customize(Connector connector) {
// 				Object defaultMaxThreads = connector.getAttribute("maxThreads");
// 				connector.setAttribute("maxThreads", MAX_THREADS);
// 				LOG.info("Changed Tomcat connector maxThreads from " + defaultMaxThreads + " to " + MAX_THREADS);
// 			}
// 		});
// 	}
// }


import org.myazure.weixin.configuration.AppUrlService;
import org.myazure.weixin.configuration.MyazureEmbeddedServletContainerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
package org.myazure.weixin;

/**
 * 
 * @author WangZhen
 *
 */
@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableTransactionManagement
@EnableJpaRepositories
@EnableJpaAuditing
@SpringBootApplication
// @EnableCaching
public class MyazureWeiXin {

	@SuppressWarnings("unused")
	private static final Logger LOG = LoggerFactory.getLogger(MyazureWeiXin.class);


	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate(clientHttpRequestFactory());
	}

	@Bean
	public BCryptPasswordEncoder passwordEncoder() {
		return new BCryptPasswordEncoder();
	}

	@Bean
// Path: src/main/java/org/myazure/weixin/configuration/AppUrlService.java
// public class AppUrlService {
// 
//     @Value("${myazure.appUrl}")
//     private String appUrl;
// 
//     public AppUrlService() {
// 
//     }
// 
//     public void setAppUrl(String appUrl) {
//         this.appUrl = appUrl;
//     }
// 
//     public String getAppUrl() {
//         return appUrl;
//     }
// }
// 
// Path: src/main/java/org/myazure/weixin/configuration/MyazureEmbeddedServletContainerCustomizer.java
// public class MyazureEmbeddedServletContainerCustomizer implements EmbeddedServletContainerCustomizer {
// 
// 	private static final Logger LOG = LoggerFactory.getLogger(MyazureEmbeddedServletContainerCustomizer.class);
// 
// 	@Value("${servlet.container.maxThreads}")
// 	private int MAX_THREADS;
// 
// 	@Override
// 	public void customize(ConfigurableEmbeddedServletContainer factory) {
// 		if (factory instanceof TomcatEmbeddedServletContainerFactory) {
// 			customizeTomcat((TomcatEmbeddedServletContainerFactory) factory);
// 		}
// 	}
// 
// 	public void customizeTomcat(TomcatEmbeddedServletContainerFactory factory) {
// 		factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
// 			@Override
// 			public void customize(Connector connector) {
// 				Object defaultMaxThreads = connector.getAttribute("maxThreads");
// 				connector.setAttribute("maxThreads", MAX_THREADS);
// 				LOG.info("Changed Tomcat connector maxThreads from " + defaultMaxThreads + " to " + MAX_THREADS);
// 			}
// 		});
// 	}
// }


// Path: src/main/java/org/myazure/weixin/MyazureWeiXin.java
import org.myazure.weixin.configuration.AppUrlService;
import org.myazure.weixin.configuration.MyazureEmbeddedServletContainerCustomizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

package org.myazure.weixin;

/**
 * 
 * @author WangZhen
 *
 */
@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableTransactionManagement
@EnableJpaRepositories
@EnableJpaAuditing
@SpringBootApplication
// @EnableCaching
public class MyazureWeiXin {

	@SuppressWarnings("unused")
	private static final Logger LOG = LoggerFactory.getLogger(MyazureWeiXin.class);


	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate(clientHttpRequestFactory());
	}

	@Bean
	public BCryptPasswordEncoder passwordEncoder() {
		return new BCryptPasswordEncoder();
	}

	@Bean
	public AppUrlService appUrlService() {