当前位置:网站首页>internship:Swagger下注解的涉及 接口的提供
internship:Swagger下注解的涉及 接口的提供
2022-06-25 16:28:00 【ahyo】
knife4j:
Knife4j是一款可以提供在线API文档的框架,是基于Swagger框架实现的
也就是一些相较于之前 没使用过的注解:
@API
拥有两个属性:value、tags,源码如下
//If tags is not used,this value will be used to set the tag for the operations described by this resource. Otherwise, the value will be ignored.
String value() default "";
//Tags can be used for logical grouping of operations by resources or any other qualifier.
String[] tags() default {
""};
@Api(tags = "list1")
@Api(tags = {
"list1","list2"})
@ApiOperation
使用于在方法上,表示一个http请求的操作
源码中属性太多,记几个比较常用
value——用于方法描述
notes——用于提示内容
tags——可以重新分组
@ApiParam
使用在方法上或者参数上,字段说明;表示对参数的添加元数据(说明或是否必填等)
name–参数名
value–参数说明
required–是否必填
@ApiModel()
使用在类上,表示对类进行说明,用于参数用实体类接收
value–表示对象名
description–描述
@ApiModelProperty()
使用在方法,字段上,表示对model属性的说明或者数据操作更改
value–字段说明
name–重写属性名字
dataType–重写属性类型
required–是否必填
example–举例说明
hidden–隐藏
边栏推荐
- 绕过技术聊'跨端'......
- Beginner bug set
- Uniapp to preview pictures (single / multiple)
- 使用hbuilder X创建uniapp项目
- 【 apprentissage automatique】 cas de prévision et d'analyse de l'examen d'entrée à l'Université basé sur des séries chronologiques multiples
- Read AFN through - from the creation of manager to the completion of data parsing
- 微信公众号服务器配置
- 批量--07---断点重提
- Day_ fourteen
- 【效率】又一款笔记神器开源了!
猜你喜欢
随机推荐
Swift responsive programming
Mysql database multi table query
Apijson simple to use
Wechat official account server configuration
The first day of reading mysql45
mysql使用过程中遇到的问题
How to view the change trend of cloud database from the behind of the launch of tidb to Alibaba cloud
Unity技术手册 - 干扰/噪音/杂波(Noise)子模块
SDN系统方法 | 10. SDN的未来
APIJSON简单使用
Wireshark network card cannot be found or does not display the problem
3. conditional probability and independence
Coredata data persistence
3.条件概率与独立性
Notes: lbcf: a Large Scale budget Constrained causal Forest Algorithm
Paper notes: lbcf: a large scale budget constrained causal forest algorithm
千万级购物车系统缓存架构方案
【精通高并发】深入理解C语言基础与汇编下的C语言
卡尔曼时间序列预测
Shuttle pop-up returns to the upper level









