SvrBaseApplication.java 1.0 KB

12345678910111213141516171819202122232425
  1. package com.yihu.jw;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
  5. import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
  6. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  7. import org.springframework.cloud.client.loadbalancer.LoadBalanced;
  8. import org.springframework.cloud.context.config.annotation.RefreshScope;
  9. import org.springframework.context.annotation.Bean;
  10. import org.springframework.context.annotation.ComponentScan;
  11. import org.springframework.web.client.RestTemplate;
  12. /**
  13. * Created by chenweida on 2017/5/10.
  14. * localhost:10020/refresh 刷新当个微服务的配置 可以在需要刷新的bean上面@RefreshScope
  15. */
  16. @SpringBootApplication
  17. @EnableDiscoveryClient//服务注册到发现服务
  18. public class SvrBaseApplication {
  19. public static void main(String[] args) {
  20. SpringApplication.run(SvrBaseApplication.class, args);
  21. }
  22. }