FlowApplication.java 880 B

1234567891011121314151617181920212223242526
  1. package com.flow;
  2. import org.mybatis.spring.annotation.MapperScan;
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.boot.web.client.RestTemplateBuilder;
  6. import org.springframework.context.annotation.Bean;
  7. import org.springframework.scheduling.annotation.EnableAsync;
  8. import org.springframework.scheduling.annotation.EnableScheduling;
  9. import org.springframework.web.client.RestTemplate;
  10. @MapperScan(basePackages = "com.flow.dao")
  11. @SpringBootApplication
  12. // 开启定时任务
  13. @EnableScheduling
  14. // 开启异步
  15. @EnableAsync
  16. public class FlowApplication {
  17. public static void main(String[] args) {
  18. SpringApplication.run(FlowApplication.class, args);
  19. }
  20. @Bean
  21. public RestTemplate restTemplate(RestTemplateBuilder builder) {
  22. return builder.build();
  23. }
  24. }