|
@@ -6,15 +6,17 @@ import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
import org.springframework.cache.annotation.EnableCaching;
|
|
import org.springframework.cache.annotation.EnableCaching;
|
|
|
|
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
|
|
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
|
|
|
@SpringBootApplication(scanBasePackages = "com.steerinfo.**")
|
|
@SpringBootApplication(scanBasePackages = "com.steerinfo.**")
|
|
@MapperScan("com.steerinfo.**")//该注解会扫描 mapper 包下的接口,把接口生成代理对象并加入到 spring 容器中
|
|
@MapperScan("com.steerinfo.**")//该注解会扫描 mapper 包下的接口,把接口生成代理对象并加入到 spring 容器中
|
|
@EnableConfigurationProperties(DruidConfig.class)//手动开启druid数据源
|
|
@EnableConfigurationProperties(DruidConfig.class)//手动开启druid数据源
|
|
-@EnableFeignClients
|
|
|
|
@EnableHystrix
|
|
@EnableHystrix
|
|
@EnableCaching
|
|
@EnableCaching
|
|
|
|
+@EnableFeignClients
|
|
|
|
+@EnableDiscoveryClient
|
|
public class DataSouceApplication {
|
|
public class DataSouceApplication {
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(DataSouceApplication.class, args);
|
|
SpringApplication.run(DataSouceApplication.class, args);
|