Application.java 990 B

123456789101112131415161718192021222324
  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.web.client.RestTemplate;
  11. /**
  12. * Created by chenweida on 2017/5/10.
  13. * localhost:10020/refresh 刷新当个微服务的配置 可以在需要刷新的bean上面@RefreshScope
  14. */
  15. @SpringBootApplication
  16. @EnableDiscoveryClient//服务注册到发现服务
  17. public class Application {
  18. public static void main(String[] args) {
  19. SpringApplication.run(Application.class, args);
  20. }
  21. }