|  | @@ -1,11 +1,63 @@
 | 
	
		
			
				|  |  |  package com.zswl.dataservicestarter.config;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.mongodb.MongoClientSettings;
 | 
	
		
			
				|  |  | +import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | +import lombok.extern.java.Log;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | +import org.springframework.boot.ApplicationArguments;
 | 
	
		
			
				|  |  | +import org.springframework.boot.ApplicationRunner;
 | 
	
		
			
				|  |  | +import org.springframework.context.ApplicationContext;
 | 
	
		
			
				|  |  | +import org.springframework.context.annotation.Bean;
 | 
	
		
			
				|  |  |  import org.springframework.context.annotation.Configuration;
 | 
	
		
			
				|  |  | +import org.springframework.core.env.Environment;
 | 
	
		
			
				|  |  | +import org.springframework.util.StringUtils;
 | 
	
		
			
				|  |  | +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 | 
	
		
			
				|  |  | +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 | 
	
		
			
				|  |  | +import springfox.documentation.builders.ApiInfoBuilder;
 | 
	
		
			
				|  |  | +import springfox.documentation.builders.PathSelectors;
 | 
	
		
			
				|  |  | +import springfox.documentation.builders.RequestHandlerSelectors;
 | 
	
		
			
				|  |  | +import springfox.documentation.oas.annotations.EnableOpenApi;
 | 
	
		
			
				|  |  | +import springfox.documentation.service.ApiInfo;
 | 
	
		
			
				|  |  | +import springfox.documentation.service.Contact;
 | 
	
		
			
				|  |  | +import springfox.documentation.spi.DocumentationType;
 | 
	
		
			
				|  |  | +import springfox.documentation.spring.web.plugins.Docket;
 | 
	
		
			
				|  |  | +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.ArrayList;
 | 
	
		
			
				|  |  | +import java.util.Collection;
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Vector;
 | 
	
		
			
				|  |  | +import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   *
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  | -//@Configuration
 | 
	
		
			
				|  |  | +@Log
 | 
	
		
			
				|  |  | +@EnableOpenApi
 | 
	
		
			
				|  |  | +@Configuration
 | 
	
		
			
				|  |  | +@EnableSwagger2WebMvc
 | 
	
		
			
				|  |  |  public class SwaggerConfig {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Value("${spring.application.name}")
 | 
	
		
			
				|  |  | +    private String applicationName;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Bean
 | 
	
		
			
				|  |  | +    public Docket defaultApi() {
 | 
	
		
			
				|  |  | +        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).groupName(applicationName).select()
 | 
	
		
			
				|  |  | +                // 添加@Api注解才显示
 | 
	
		
			
				|  |  | +                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
 | 
	
		
			
				|  |  | +                // 这里指定Controller扫描包路径
 | 
	
		
			
				|  |  | +                .paths(PathSelectors.any()).build();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * swagger-api接口描述信息
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    private ApiInfo apiInfo() {
 | 
	
		
			
				|  |  | +        return new ApiInfoBuilder().title("API文档")
 | 
	
		
			
				|  |  | +                .description("中数未来数据服务")
 | 
	
		
			
				|  |  | +                .contact(new Contact("RTX", "", ""))
 | 
	
		
			
				|  |  | +                .version("1.0.0").build();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |