| | |
| | | .build() |
| | | .securitySchemes(Collections.singletonList(securityScheme())) |
| | | .securityContexts(securityContexts()) |
| | | .globalOperationParameters(setHeaderToken()); |
| | | .globalOperationParameters(setHeaderToken()) |
| | | .groupName("default"); |
| | | } |
| | | |
| | | /** |
| | | * swagger2的配置文件,这里可以配置swagger2的一些基本的内容,比如扫描的包等等 (MDC) |
| | | * |
| | | * @return Docket |
| | | */ |
| | | @Bean(value = "defaultApi") |
| | | public Docket defaultApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | //此包路径下的类,才生成接口文档 |
| | | .apis(RequestHandlerSelectors.basePackage("org.jeecg.modules.mdc")) |
| | | //加了ApiOperation注解的类,才生成接口文档 |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .securitySchemes(Collections.singletonList(securityScheme())) |
| | | .securityContexts(securityContexts()) |
| | | .globalOperationParameters(setHeaderToken()) |
| | | .groupName("MDC"); |
| | | } |
| | | |
| | | /*** |