ServerApplication.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.persagy;
  2. import cn.hutool.extra.spring.EnableSpringUtil;
  3. import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
  4. import com.persagy.log.annotation.EnableControllerLog;
  5. import org.mybatis.spring.annotation.MapperScan;
  6. import org.springframework.boot.Banner;
  7. import org.springframework.boot.SpringApplication;
  8. import org.springframework.boot.autoconfigure.SpringBootApplication;
  9. import org.springframework.cache.annotation.EnableCaching;
  10. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  11. import org.springframework.cloud.openfeign.EnableFeignClients;
  12. import org.springframework.context.annotation.Configuration;
  13. import org.springframework.scheduling.annotation.EnableScheduling;
  14. /**
  15. * springboot服务器
  16. * 同时启动Eureka和Feign
  17. * @author Charlie Yu
  18. * @version 1.0 2021-03-02
  19. */
  20. @EnableCaching(proxyTargetClass = true)
  21. @EnableFeignClients(basePackages="com.persagy.fm.**.client")
  22. @EnableControllerLog
  23. @EnableDiscoveryClient
  24. @Configuration
  25. @EnableScheduling
  26. @MapperScan(value = "com.persagy.fm.*.dao")
  27. @EnableSpringUtil
  28. @SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)
  29. public class ServerApplication {
  30. public static void main(String[] args) {
  31. SpringApplication application = new SpringApplication(ServerApplication.class);
  32. application.setBannerMode(Banner.Mode.OFF);
  33. application.run(args);
  34. }
  35. }