审查视图

src/main/java/com/tianbo/analysis/CustomAnalysisBootApplication.java 1.3 KB
朱兆平 authored
1 2 3 4
/**
 * @author mrz
 * @email 17966059@qq.com
 */
朱兆平 authored
5
package com.tianbo.analysis;
朱兆平 authored
6
7 8
import com.tianbo.analysis.bean.SpringBeanUtitl;
import com.tianbo.analysis.bean.WlptBaseModel;
朱兆平 authored
9 10 11
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
朱兆平 authored
12 13 14 15 16
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
朱兆平 authored
17
import org.springframework.scheduling.annotation.EnableScheduling;
朱兆平 authored
18
import org.springframework.transaction.annotation.EnableTransactionManagement;
朱兆平 authored
19
import org.springframework.web.client.RestTemplate;
朱兆平 authored
20
21 22
import java.time.Duration;
朱兆平 authored
23
@SpringBootApplication
朱兆平 authored
24
@EnableScheduling
朱兆平 authored
25
@EnableDiscoveryClient
朱兆平 authored
26
@EnableTransactionManagement
朱兆平 authored
27
@MapperScan("com.tianbo.analysis.dao")
28
public class CustomAnalysisBootApplication {
朱兆平 authored
29 30

	public static void main(String[] args) {
31
		SpringApplication.run(CustomAnalysisBootApplication.class, args);
朱兆平 authored
32 33
	}
朱兆平 authored
34
	@Bean
35
//	@LoadBalanced
朱兆平 authored
36 37
	RestTemplate restTemplate(RestTemplateBuilder builder){
38
		return builder.setConnectTimeout(Duration.ofSeconds(3)).setReadTimeout(Duration.ofSeconds(3))
39
				.build();
朱兆平 authored
40
	}
朱兆平 authored
41 42
}