123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package com.yihu.wlyy.config;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.web.context.request.async.DeferredResult;
- import org.springframework.web.servlet.config.annotation.EnableWebMvc;
- import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
- import springfox.documentation.builders.ApiInfoBuilder;
- import springfox.documentation.builders.PathSelectors;
- 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.EnableSwagger2;
- @Configuration
- @EnableWebMvc
- @EnableSwagger2
- @ComponentScan("com.yihu.wlyy.controller")
- public class SwaggerConfig extends WebMvcConfigurerAdapter {
- @Bean
- public Docket patientApi(){
- return new Docket(DocumentationType.SWAGGER_2)
- .groupName("Wlyy-manager")
- .genericModelSubstitutes(DeferredResult.class)
- .useDefaultResponseMessages(false)
- .forCodeGeneration(true)
- .pathMapping("/")
- .select()
- .paths(PathSelectors.regex("/customer/.*"))
- .build()
- .apiInfo(patientApiInfo());
- }
- private ApiInfo patientApiInfo() {
- return new ApiInfoBuilder()
- .title("三师后台管理 RESTful APIs")
- .description("三师后台管理 Rest API, all the applications could access the Object model data via JSON")
- .termsOfServiceUrl("NO terms of service")
- .version("1.0")
- .contact(new Contact("yww@jkzl.com", "", ""))
- .license("The Apache License, Version 2.0")
- .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
- .build();
- }
- }
|