# swagger组件

# 引入maven 包

 <dependency>
            <groupId>com.fast4cloud</groupId>
            <artifactId>framework-starter-swagger</artifactId>
        </dependency>
1
2
3
4

# 在yml 配置信息如下

swagger:
  description: test
  termsOfServiceUrl: http://www.baidu.com/
  contact: 1394465750@qq.com
  version: 1.0``
  groupName: 2.X版本
  #标题
  title: fastCloud
1
2
3
4
5
6
7
8

# 访问地址为:http://xxxx:port/xxx/doc.html

# 当然,你也可以对其swagger进行设置账户密码.引入如下配置信息

#访问地址
#http://127.0.0.1:8060/fast-demo/doc.html
springdoc:
  swagger-ui:
    path: /swagger-ui.html
    tags-sorter: alpha
    operations-sorter: alpha
  api-docs:
    path: /v3/api-docs
  group-configs:
    - group: 'default'
      paths-to-match: '/**'
      #扫描路径
      packages-to-scan: com.github.xiaoymin.boot3
  default-flat-param-object: true

knife4j:
  enable: true
  setting:
    language: zh_cn
    swagger-model-name: 实体类列表
  basic:
    enable: true
    # Basic认证用户名
    username: admin
    # Basic认证密码
    password: 123456
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

# 界面效果

# 💎 参考

🔍 knife4j配置详解 (opens new window)

Last Updated: 10/1/2023, 10:26:44 PM