Skip to content
本页导航

Springdoc 使用

引入springdoc集成包

xml
<!-- 升级 starter 至 2.7.20-SNAPSHOT及以上 -->
<dependency>
    <groupId>com.investoday.bootframework</groupId>
    <artifactId>spring-cloud-investoday-starter</artifactId>
    <version>2.7.20-SNAPSHOT</version>
</dependency>


<!-- 升级 aix-tool 至 3.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday</groupId>
	<artifactId>aix-tool</artifactId>
	<version>3.0.0-SNAPSHOT</version>
</dependency>

<!-- 升级 open-aix-tool 至 3.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday</groupId>
	<artifactId>open-aix-tool</artifactId>
	<version>3.0.0-SNAPSHOT</version>
</dependency>

<!-- 升级 aix-mybatis 至 2.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday.mybatis</groupId>
	<artifactId>aix-mybatis</artifactId>
	<version>2.0.0-SNAPSHOT</version>
</dependency>
<!-- 升级 starter 至 2.7.20-SNAPSHOT及以上 -->
<dependency>
    <groupId>com.investoday.bootframework</groupId>
    <artifactId>spring-cloud-investoday-starter</artifactId>
    <version>2.7.20-SNAPSHOT</version>
</dependency>


<!-- 升级 aix-tool 至 3.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday</groupId>
	<artifactId>aix-tool</artifactId>
	<version>3.0.0-SNAPSHOT</version>
</dependency>

<!-- 升级 open-aix-tool 至 3.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday</groupId>
	<artifactId>open-aix-tool</artifactId>
	<version>3.0.0-SNAPSHOT</version>
</dependency>

<!-- 升级 aix-mybatis 至 2.0.0-SNAPSHOT及以上 -->
<dependency>
	<groupId>com.investoday.mybatis</groupId>
	<artifactId>aix-mybatis</artifactId>
	<version>2.0.0-SNAPSHOT</version>
</dependency>

修改注解

将 swagger 2 注释替换为 swagger 3 注释,swagger 3 注释的包是io.swagger.v3.oas.annotations

  • @Api@Tag
  • @ApiIgnore@Parameter(hidden = true) or @Operation(hidden = true) or @Hidden
  • @ApiImplicitParam@Parameter
  • @ApiImplicitParams@Parameters
  • @ApiModel@Schema
  • @ApiModelProperty(hidden = true)@Schema(accessMode = READ_ONLY) @ApiModelProperty(hidden = true)@Schema(accessMode = READ_ONLY)
  • @ApiModelProperty@Schema
  • @ApiOperation(value = "foo", notes = "bar")@Operation(summary = "foo", description = "bar")
  • @ApiParam@Parameter
  • @ApiResponse(code = 404, message = "foo")@ApiResponse(responseCode = "404", description = "foo")

访问swagger页面

springfox 地址: http://localhost:8080/swagger-ui/index.html

springdoc 地址: http://localhost:8080/new/swagger-ui/index.html

lhiro