Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-certificate-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
cloud-certificate-group
Commits
faf7e5b9
Commit
faf7e5b9
authored
Oct 30, 2024
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SwaggerConfig
parent
6a419217
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
cloud-certificate-service/src/main/java/com/yizhi/certificate/application/SwaggerConfig.java
+4
-1
No files found.
cloud-certificate-service/src/main/java/com/yizhi/certificate/application/SwaggerConfig.java
View file @
faf7e5b9
package
com
.
yizhi
.
certificate
.
application
;
package
com
.
yizhi
.
certificate
.
application
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -27,6 +28,8 @@ import static springfox.documentation.builders.PathSelectors.regex;
...
@@ -27,6 +28,8 @@ import static springfox.documentation.builders.PathSelectors.regex;
@EnableSwagger2
@EnableSwagger2
public
class
SwaggerConfig
extends
WebMvcConfigurerAdapter
{
public
class
SwaggerConfig
extends
WebMvcConfigurerAdapter
{
@Value
(
"${swagger.enabled}"
)
private
boolean
swaggerEnabled
;
/**
/**
* 这个地方要重新注入一下资源文件,不然不会注入资源的,也没有注入requestHandlerMappping,相当于xml配置的
* 这个地方要重新注入一下资源文件,不然不会注入资源的,也没有注入requestHandlerMappping,相当于xml配置的
* <!--swagger资源配置-->
* <!--swagger资源配置-->
...
@@ -46,7 +49,7 @@ public class SwaggerConfig extends WebMvcConfigurerAdapter {
...
@@ -46,7 +49,7 @@ public class SwaggerConfig extends WebMvcConfigurerAdapter {
@Bean
@Bean
public
Docket
createRestApi
()
{
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
enable
(
swaggerEnabled
)
.
groupName
(
"证书服务"
)
.
groupName
(
"证书服务"
)
.
genericModelSubstitutes
(
DeferredResult
.
class
)
.
genericModelSubstitutes
(
DeferredResult
.
class
)
.
genericModelSubstitutes
(
ResponseEntity
.
class
)
.
genericModelSubstitutes
(
ResponseEntity
.
class
)
...
...
Write
Preview
Markdown
is supported
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