feat: 引入swagger ui.

This commit is contained in:
2025-08-09 01:00:58 +08:00
parent a7de8cfdb3
commit b84401e8a4
2 changed files with 22 additions and 1 deletions

View File

@@ -22,6 +22,8 @@
<mybatis-plus.version>3.5.12</mybatis-plus.version>
<!-- freemarker 版本 -->
<freemarker.version>2.3.34</freemarker.version>
<!-- webmvc-ui 版本 -->
<webmvc-ui.version>2.8.9</webmvc-ui.version>
</properties>
<dependencies>
@@ -86,6 +88,13 @@
</exclusions>
</dependency>
<!-- 接口文档生成 -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${webmvc-ui.version}</version>
</dependency>
<!-- lombok 代码生成: getter、setter等 -->
<dependency>
<groupId>org.projectlombok</groupId>

View File

@@ -4,4 +4,16 @@ spring:
datasource:
url: jdbc:mysql://localhost:3306/personal_blog?autoReconnect=true&characterEncoding=utf8
username: root
# password: password, # 密码不建议写在配置文件中, 建议利用Idea中的配置覆盖, 如果是其他IDE请自行斟酌
# password: password, # 密码不建议写在配置文件中, 建议利用Idea中的配置覆盖, 如果是其他IDE请自行斟酌
# 接口文档生成相关配置
springdoc:
swagger-ui:
path: /api.html
tags-sorter: alpha
operations-sorter: alpha
# 是否启用swagger-ui
enabled: true
api-docs:
path: /v1/api-docs
# 是否启用api文档模板, 关闭后无法使用快速导入api文档
enabled: true