UserServerApplication.java 1.2 KB

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