| | |
| | | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.nio.charset.Charset; |
| | |
| | | * 这个服务是将 系统部署为spring boot版 |
| | | * 如果是spring cloud 微服务部署 不用启动这个类 |
| | | * <p> |
| | | * excludeName = { |
| | | * "com.java110.intf.acct", |
| | | * "com.java110.intf.code", |
| | | * "com.java110.intf.common", |
| | | * "com.java110.intf.community", |
| | | * "com.java110.intf.demo", |
| | | * "com.java110.intf.dev", |
| | | * "com.java110.intf.fee", |
| | | * "com.java110.intf.goods", |
| | | * "com.java110.intf.job", |
| | | * "com.java110.intf.oa", |
| | | * "com.java110.intf.order", |
| | | * "com.java110.intf.report", |
| | | * "com.java110.intf.store", |
| | | * "com.java110.intf.user" |
| | | * } |
| | | * |
| | | * @version v0.1 |
| | | * @auther com.java110.wuxw |
| | |
| | | "com.java110.user", |
| | | "com.java110.doc", |
| | | "com.java110.scm", |
| | | "com.java110.api", |
| | | "com.java110.boot" |
| | | }, |
| | | exclude = {LiquibaseAutoConfiguration.class, |
| | | org.activiti.spring.boot.SecurityAutoConfiguration.class, |
| | | org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class} |
| | | org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, |
| | | com.github.pagehelper.autoconfigure.MapperAutoConfiguration.class |
| | | } |
| | | |
| | | ) |
| | | @Java110CmdDiscovery(cmdPublishClass = ServiceCmdEventPublishing.class, |
| | |
| | | "com.java110.scm.cmd", |
| | | "com.java110.user.cmd" |
| | | }) |
| | | @EnableScheduling |
| | | @EnableAsync |
| | | //文档 |
| | | @Java110ApiDocDiscovery(basePackages = {"com.java110.boot.rest"}, apiDocClass = ApiDocPublishing.class) |
| | |
| | | @Bean |
| | | public OutRestTemplate outRestTemplate() { |
| | | StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8")); |
| | | m.setWriteAcceptCharset(false); |
| | | OutRestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(OutRestTemplate.class); |
| | | restTemplate.getInterceptors().add(java110RestTemplateInterceptor); |
| | | |
| | |
| | | @LoadBalanced |
| | | public RestTemplate restTemplate() { |
| | | StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8")); |
| | | m.setWriteAcceptCharset(false); |
| | | RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build(RestTemplate.class); |
| | | restTemplate.getInterceptors().add(java110RestTemplateInterceptor); |
| | | //设置超时时间 |
| | | HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory(); |
| | | httpRequestFactory.setConnectionRequestTimeout(10000); |
| | | httpRequestFactory.setConnectTimeout(10000); |
| | | httpRequestFactory.setReadTimeout(10000); |
| | | restTemplate.setRequestFactory(httpRequestFactory); |
| | | return restTemplate; |
| | | } |
| | | |
| | |
| | | Environment.setSystemStartWay(Environment.SPRING_BOOT); |
| | | |
| | | //刷新缓存 |
| | | flushMainCache(args); |
| | | // flushMainCache(args); |
| | | |
| | | //服务启动完成 |
| | | ServiceStartInit.printStartSuccessInfo(); |