SealClassApplication.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.ym;
  2. import lombok.extern.slf4j.Slf4j;
  3. import org.mybatis.spring.annotation.MapperScan;
  4. import org.springframework.boot.SpringApplication;
  5. import org.springframework.boot.autoconfigure.SpringBootApplication;
  6. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  7. import org.springframework.cloud.client.loadbalancer.LoadBalanced;
  8. import org.springframework.cloud.openfeign.EnableFeignClients;
  9. import org.springframework.context.annotation.Bean;
  10. import org.springframework.context.annotation.ComponentScan;
  11. import org.springframework.context.annotation.Configuration;
  12. import org.springframework.context.annotation.EnableAspectJAutoProxy;
  13. import org.springframework.scheduling.annotation.EnableAsync;
  14. import org.springframework.scheduling.annotation.EnableScheduling;
  15. import org.springframework.web.client.RestTemplate;
  16. @EnableAspectJAutoProxy
  17. @Slf4j
  18. @SpringBootApplication
  19. @EnableFeignClients("com.ym.mec")
  20. @MapperScan(basePackages = {"com.ym.mec.biz.dal.dao", "com.ym.mec.biz.dal.mapper"})
  21. @ComponentScan(basePackages = {"com.ym", "com.mec.redisson", "com.yonge.log"})
  22. @EnableScheduling
  23. @EnableDiscoveryClient
  24. @Configuration
  25. @EnableAsync
  26. public class SealClassApplication {
  27. public static void main(String[] args) {
  28. SpringApplication.run(SealClassApplication.class, args);
  29. log.info("SealClassApplication started");
  30. }
  31. @Bean
  32. @LoadBalanced
  33. public RestTemplate restTemplate(){
  34. return new RestTemplate();
  35. }
  36. }