|
@@ -33,6 +33,8 @@ import org.springframework.boot.SpringApplication
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication
|
|
|
import org.springframework.boot.builder.SpringApplicationBuilder
|
|
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
|
|
|
+import org.springframework.cloud.client.loadbalancer.LoadBalanced
|
|
|
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient
|
|
|
//import org.springframework.cloud.client.loadbalancer.LoadBalanced
|
|
|
//import org.springframework.cloud.netflix.eureka.EnableEurekaClient
|
|
|
import org.springframework.context.annotation.Bean
|
|
@@ -51,7 +53,7 @@ import org.springframework.web.client.RestTemplate
|
|
|
@EnableScheduling //开启定时注解
|
|
|
@ComponentScan(basePackages = ["com.persagy", "com.persagy.server"]) // 配置组件扫描路径
|
|
|
@MapperScan("com.persagy", "com.persagy.server") // Mapper组件扫描路径
|
|
|
-//@EnableEurekaClient
|
|
|
+@EnableEurekaClient
|
|
|
@SpringBootApplication
|
|
|
open class DataSynApp : SpringBootServletInitializer() {
|
|
|
companion object {
|
|
@@ -61,7 +63,7 @@ open class DataSynApp : SpringBootServletInitializer() {
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
-// @LoadBalanced //在注册中心里进行查找微服务,负载均衡
|
|
|
+ @LoadBalanced //在注册中心里进行查找微服务,负载均衡
|
|
|
open fun restTemplate(): RestTemplate? {
|
|
|
return RestTemplate()
|
|
|
}
|