|
@@ -33,9 +33,13 @@ public class SwaggerConfig
|
|
|
@Autowired
|
|
|
private RuoYiConfig ruoyiConfig;
|
|
|
|
|
|
-
|
|
|
- @Value("${swagger.enable}")
|
|
|
- private boolean swaggerEnable;
|
|
|
+
|
|
|
+ @Value("${swagger.enabled}")
|
|
|
+ private boolean enabled;
|
|
|
+
|
|
|
+
|
|
|
+ @Value("${swagger.pathMapping}")
|
|
|
+ private String pathMapping;
|
|
|
|
|
|
|
|
|
* 创建API
|
|
@@ -45,8 +49,7 @@ public class SwaggerConfig
|
|
|
{
|
|
|
return new Docket(DocumentationType.SWAGGER_2)
|
|
|
|
|
|
- .enable(swaggerEnable)
|
|
|
- .pathMapping("/dev-api")
|
|
|
+ .enable(enabled)
|
|
|
|
|
|
.apiInfo(apiInfo())
|
|
|
|
|
@@ -54,13 +57,14 @@ public class SwaggerConfig
|
|
|
|
|
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
.paths(PathSelectors.any())
|
|
|
.build()
|
|
|
|
|
|
.securitySchemes(securitySchemes())
|
|
|
- .securityContexts(securityContexts());
|
|
|
+ .securityContexts(securityContexts())
|
|
|
+ .pathMapping(pathMapping);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -72,7 +76,7 @@ public class SwaggerConfig
|
|
|
apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
|
|
|
return apiKeyList;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
* 安全上下文
|
|
|
*/
|
|
@@ -86,7 +90,7 @@ public class SwaggerConfig
|
|
|
.build());
|
|
|
return securityContexts;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
* 默认的安全上引用
|
|
|
*/
|