SealClassApplication.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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.EnableAsync;
  12. import org.springframework.scheduling.annotation.EnableScheduling;
  13. import org.springframework.web.client.RestTemplate;
  14. @EnableAspectJAutoProxy
  15. @Slf4j
  16. @SpringBootApplication
  17. @EnableFeignClients("com.ym")
  18. @EnableScheduling
  19. @EnableDiscoveryClient
  20. @Configuration
  21. @EnableAsync
  22. public class SealClassApplication {
  23. public static void main(String[] args) {
  24. SpringApplication.run(SealClassApplication.class, args);
  25. log.info("SealClassApplication started");
  26. }
  27. @Bean
  28. @LoadBalanced
  29. public RestTemplate restTemplate(){
  30. return new RestTemplate();
  31. }
  32. }