# 集成Swagger 0.3.0+
# Maven引入
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# SpringBoot配置
需在启动类加 @EnableSwagger2
以下配置是可选的配置项(可省略)
magic-api:
swagger-config:
# 资源名称
name: MagicAPI
# 资源描述
description: MagicAPI v1.0 接口文档
# 资源位置
location: /v2/api-docs/magic-api/swagger2.json
# 文档版本
version: 1.0
# 文档标题
title: MagicAPI v1.0 接口文档
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
← 在Java中调用接口 自定义SQL拦截器 →