Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
951cb6b1
Unverified
Commit
951cb6b1
authored
Aug 25, 2022
by
Kerwin
Committed by
GitHub
Aug 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature] Add swagger api doc (#954)
* Add swagger api doc * update datasource config info in the application file
parent
b3ad0a5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
pom.xml
dlink-admin/pom.xml
+4
-0
Knife4jConfiguration.java
...c/main/java/com/dlink/configure/Knife4jConfiguration.java
+39
-0
application.yml
dlink-admin/src/main/resources/application.yml
+7
-2
pom.xml
pom.xml
+6
-0
No files found.
dlink-admin/pom.xml
View file @
951cb6b1
...
@@ -42,6 +42,10 @@
...
@@ -42,6 +42,10 @@
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
dlink-admin/src/main/java/com/dlink/configure/Knife4jConfiguration.java
0 → 100644
View file @
951cb6b1
package
com
.
dlink
.
configure
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Configuration
@EnableSwagger2
public
class
Knife4jConfiguration
{
@Bean
(
value
=
"defaultApi2"
)
public
Docket
defaultApi2
()
{
Docket
docket
=
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
groupName
(
"V1.0"
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.dlink.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
return
docket
;
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"Dlink REST APIS"
)
.
description
(
"Dlink REST APIS"
)
.
version
(
"1.0"
)
.
build
();
}
}
dlink-admin/src/main/resources/application.yml
View file @
951cb6b1
...
@@ -6,6 +6,9 @@ spring:
...
@@ -6,6 +6,9 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
application
:
application
:
name
:
dlink
name
:
dlink
mvc
:
pathmatch
:
matching-strategy
:
ant_path_matcher
main
:
main
:
allow-circular-references
:
true
allow-circular-references
:
true
# flyway:
# flyway:
...
@@ -62,4 +65,7 @@ sa-token:
...
@@ -62,4 +65,7 @@ sa-token:
# token风格
# token风格
token-style
:
uuid
token-style
:
uuid
# 是否输出操作日志
# 是否输出操作日志
is-log
:
false
is-log
:
false
\ No newline at end of file
knife4j
:
enable
:
true
pom.xml
View file @
951cb6b1
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<javax.mail>
1.6.2
</javax.mail>
<javax.mail>
1.6.2
</javax.mail>
<poi.version>
4.1.2
</poi.version>
<poi.version>
4.1.2
</poi.version>
<commons-email>
1.5
</commons-email>
<commons-email>
1.5
</commons-email>
<knife4j.version>
3.0.3
</knife4j.version>
</properties>
</properties>
<dependencyManagement>
<dependencyManagement>
...
@@ -122,6 +123,11 @@
...
@@ -122,6 +123,11 @@
<type>
pom
</type>
<type>
pom
</type>
<scope>
import
</scope>
<scope>
import
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
${knife4j.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
...
...
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