Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
12171b12
Commit
12171b12
authored
Aug 08, 2021
by
msgroup
Browse files
优化api配置
parent
3a988177
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/config/SwaggerConfig.java
View file @
12171b12
...
...
@@ -20,6 +20,7 @@
*/
package
net.mingsoft.config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -38,10 +39,13 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@ConditionalOnProperty
(
prefix
=
"ms"
,
name
=
"swagger-enable"
,
havingValue
=
"true"
)
public
class
SwaggerConfig
{
@Value
(
"${ms.manager.path}"
)
private
String
mangerPath
;
@Bean
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
).
apiInfo
(
apiInfo
()).
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"net.mingsoft"
)).
paths
(
PathSelectors
.
any
(
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"net.mingsoft"
)).
paths
(
PathSelectors
.
regex
(
"^((?!("
+
mangerPath
+
"|static)).)+$"
))
.
build
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment