TaskApplication.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.keao.edu.task;
  2. import org.mybatis.spring.annotation.MapperScan;
  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.ComponentScan;
  10. import org.springframework.context.annotation.Configuration;
  11. import org.springframework.scheduling.annotation.EnableAsync;
  12. import org.springframework.web.client.RestTemplate;
  13. import com.spring4all.swagger.EnableSwagger2Doc;
  14. @SpringBootApplication
  15. @EnableDiscoveryClient
  16. @EnableFeignClients("com.keao.edu")
  17. @MapperScan({"com.keao.edu.task.dal.dao","com.keao.edu.common.dao"})
  18. @ComponentScan("com.keao.edu")
  19. @Configuration
  20. @EnableSwagger2Doc
  21. @EnableAsync
  22. public class TaskApplication {
  23. public static void main(String[] args) {
  24. SpringApplication.run(TaskApplication.class, args);
  25. }
  26. @Bean
  27. @LoadBalanced
  28. public RestTemplate restTemplate(){
  29. return new RestTemplate();
  30. }
  31. }