如果配置修改
springfox:
documentation:
enabled: true
swagger-ui:
base-url: /
访问是如下
http://localhost:8910/swagger-ui/index.html#
如果 base-url: /swagger/
http://localhost:8910/swagger/swagger-ui/index.html#
http://localhost:8910/swagger/api-doc
application-dev.yml
java
spring:
# 安全配置
mvc:
pathmatch:
matching-strategy: ant_path_matcher
springfox:
documentation:
enabled: true
swagger-ui:
base-url: /swagger/
swagger:
enabled: true
pathMapping: /
title: API 文档
description: API 文档
version: 1.0
contact:
name: developer
email: developer@example.com
base-package: com.jxtech.hkcms
# 日志配置
logging:
level:
root: INFO
org.springframework: INFO
com.jxtech: DEBUG
springfox: INFO
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"
file:
path: log
name: hkcms.log
pom.xml
java
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-core</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<!--swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-ui</artifactId>
<version>3.0.3</version>
</dependency>
实体类上
java
@MapperXml(compId = "base", xmlFile = "/config/base/bean/AimAttribute.xml")
public class AimAttribute extends AbstractBean {
}
iac-hkcms