Swagger配置类

@Configuration
@EnableSwagger2
public class SwaggerConfig {

        @Bean
        public Docket webApiConfig(){
            return new Docket(DocumentationType.SWAGGER_2)
                    .groupName("和振斌")
                    .apiInfo(webApiInfo())
                    .select()
                    .paths(Predicates.not(PathSelectors.regex("/admin/.*")))
                    .paths(Predicates.not(PathSelectors.regex("/error.*")))
                    .build();
        }

        private ApiInfo webApiInfo(){
            return new ApiInfoBuilder()
                    .title("和振斌··网站-课程中心API文档")
                    .description("本文档描述了课程中心微服务接口定义")
                    .version("1.0")
                    .contact(new Contact("Helen", "", "986125495@qq.com"))
                    .build();
        }
    }

原文地址:https://www.cnblogs.com/HezhenbinGoGo/p/14243223.html