content: package org.superboot.config;
  
  import org.springframework.context.annotation.Primary;
  import org.springframework.stereotype.Component;
  import springfox.documentation.swagger.web.SwaggerResource;
  import springfox.documentation.swagger.web.SwaggerResourcesProvider;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  /**
   * <b> 文档统一入口 </b>
   * <p>
   * 功能描述:提供API文档对外的统一入口服务
   * </p>
   *
   */
  @Component
  @Primary
  public class DocumentationConfig implements SwaggerResourcesProvider {
      @Override
      public List<SwaggerResource> get() {
          List resources = new ArrayList<>();
          resources.add(swaggerResource("公共服务", "/v2/api-docs", "1.0-SNAPSHOT"));
          resources.add(swaggerResource("用户中心", "/UserApi/v2/api-docs", "1.0-SNAPSHOT"));
          return resources;
      }
  
      private SwaggerResource swaggerResource(String name, String location, String version) {
          SwaggerResource swaggerResource = new SwaggerResource();
          swaggerResource.setName(name);
          swaggerResource.setLocation(location);
          swaggerResource.setSwaggerVersion(version);
          return swaggerResource;
      }
  }