@Api:用于类;表示标识这个类是swagger的资源
| 属性名称 | 数据类型 | 默认值 | 说明 |
| value | String | "" | 字段说明 |
| tags | String[] | "" | 标签说明 |
| description | String | "" | 详情描述 |
| basePath |
String | "" | 基本路径可以不配置 |
| position | int | "" | 如果配置多个Api 想改变显示的顺序位置 |
| produces | String | "" | 提供者 (For example, "application/json, application/xml") |
| consumes | String | "" | 消费者(For example, "application/json, application/xml") |
| protocols | String | "" | 协议(Possible values: http, https, ws, wss.) |
| authorizations | Authorization[] | "" | 高级特性认证时配置 |
| hidden | boolean | "" | 配置为true 将在文档中隐藏 |
使用实例:
注解加载在controller类上
常用模型:
1 @Api(tags = "HELLO CONTROLLER 测试功能接口") 2 @RestController 3 public class HelloController { 4 5 }