Sfoglia il codice sorgente

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 anni fa
parent
commit
52751e5f83

+ 3 - 77
patient-co/patient-co-pc/src/main/java/com/yihu/wlyy/pc/config/SwaggerConfig.java

@ -16,21 +16,18 @@ import static springfox.documentation.builders.PathSelectors.regex;
@EnableSwagger2
@Configuration
public class SwaggerConfig {
    private static final String PUBLIC_API = "Default";
    private static final String Doctor_API = "doctor";
    private static final String Patient_API = "patient";
    private static final String Other_API = "other";
    private static final String PUBLIC_API = "other";
    @Bean
    public Docket publicAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Doctor_API)
                .groupName(PUBLIC_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(PathSelectors.regex("/doctor/.*"))
                .paths(PathSelectors.regex("/.*"))
                .build()
                .apiInfo(publicApiInfo());
    }
@ -48,75 +45,4 @@ public class SwaggerConfig {
        return apiInfo;
    }
    @Bean
    public Docket patientAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Patient_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(PathSelectors.regex("/patient/.*"))
                .build()
                .apiInfo(patientApiInfo());
    }
    private ApiInfo patientApiInfo() {
        ApiInfo apiInfo = new ApiInfo("三师平台API",
                "向PC端,微信、App等应用提供功能与数据接口。",
                "1.0",
                "No terms of service",
                "admin@jkzl.com",
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }
    @Bean
    public Docket otherAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Other_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(or(
                        regex("/third/.*"),
                        regex("/statistics/.*"),
                        regex("/statistics/province/.*"),
                        regex("/job/.*"),
                        regex("/family_contract/.*"),
                        regex("/hosptail/.*"),
                        regex("/manage_util/.*"),
                        regex("/common/.*"),
                        regex("/hospitals/.*"),
                        regex("/upload/.*"),
                        regex("/weixin/.*"),
                        regex("/wx/.*"),
                        regex("/area/.*"),
                        regex("/login/.*"),
                        regex("/qrcode/.*"),
                        regex("/onepay/.*"),
                        regex("/wlyy_service/.*")
                ))
                .build()
                .apiInfo(otherApiInfo());
    }
    private ApiInfo otherApiInfo() {
        ApiInfo apiInfo = new ApiInfo("三师平台API",
                "向PC端,微信、App等应用提供功能与数据接口。",
                "1.0",
                "No terms of service",
                "admin@jkzl.com",
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }
}