Skip to content

xiejiashuai/spring-boot-common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Start

本工程是对Spring Boot 2.0.6.RELEASE的扩展,主要提供了接口注解支、Feign 统一日志输出、SpringQueryMap注解支持

  • 引入依赖

     		 <dependency>
            <groupId>com.aihuishou.c2b.service.framework</groupId>
            <artifactId>customize-boot2</artifactId>
            <version>1.0.0-SNAPSHOT</version>
          </dependency>
  • 激活注解

    • 在应用程序驱动类上添加@AdvancedSpringBootApplication注解

      @AdvancedSpringBootApplication
      public class DispatcherServiceApplication extends SpringBootServletInitializer {
      
          @Override
          protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
              builder.sources(DispatcherServiceApplication.class);
              return super.configure(builder);
          }
      
          public static void main(String[] args) {
              new SpringApplicationBuilder()
                      .sources(DispatcherServiceApplication.class)
                      .run();
          }
      
      }

      说明 @AdvancedSpringBootApplication= @SpringBootApplication + @EnableBoot2Customizing + @EnableFeignClients

      @EnableBoot2Customizing用于自定义化Spring Boot2配置,详细请参考CustomizedAutoConfiguration

      如果项目中不需要Feign可进行单独注解

  • 请排除原声的io.springfox:springfox-spring-web依赖,引入定制化的springfox-spring-web

    说明: 原生的springfox-spring-web无法获取接口上的注解

    io.springfox:springfox-spring-web支持获取接口上的注解

  • 按照上述进行配置,理论上可使用前文所描述的所有功能,如有不符合,欢迎一起探讨。

About

Spring Boot 2.x 通用配置工程

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages