SealClassApplication.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package com.ym;
  2. import lombok.extern.slf4j.Slf4j;
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  6. import org.springframework.cloud.client.loadbalancer.LoadBalanced;
  7. import org.springframework.cloud.openfeign.EnableFeignClients;
  8. import org.springframework.context.annotation.Bean;
  9. import org.springframework.context.annotation.Configuration;
  10. import org.springframework.context.annotation.EnableAspectJAutoProxy;
  11. import org.springframework.scheduling.annotation.EnableScheduling;
  12. import org.springframework.web.client.RestTemplate;
  13. @EnableAspectJAutoProxy
  14. @Slf4j
  15. @SpringBootApplication
  16. @EnableFeignClients("com.ym")
  17. @EnableScheduling
  18. @EnableDiscoveryClient
  19. @Configuration
  20. public class SealClassApplication {
  21. public static void main(String[] args) {
  22. SpringApplication.run(SealClassApplication.class, args);
  23. log.info("SealClassApplication started");
  24. }
  25. @Bean
  26. @LoadBalanced
  27. public RestTemplate restTemplate(){
  28. return new RestTemplate();
  29. }
  30. }