当前位置:网站首页>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–隐藏
边栏推荐
- What plug-ins are available for vscade?
- Helsinki traffic safety improvement project deploys velodyne lidar Intelligent Infrastructure Solution
- _ 19_ IO stream summary
- Optimization of lazyagg query rewriting in parsing data warehouse
- Hash table, generic
- XML usage and parsing of data storage and transmission files
- Catheon gaming appointed mark Aubrey, former Asia Pacific head of Activision Blizzard, as CEO
- Day_ ten
- Kalman Filter 遇到 Deep Learning : 卡尔曼滤波和深度学习有关的论文
- Kettle表输入组件精度丢失的问题
猜你喜欢
随机推荐
根据先序遍历和中序遍历生成后序遍历
Read mysql45 - a simple understanding of global locks and table locks
八种button的hover效果
Paper notes: generalized random forests
从TiDB上线阿里云的背后,如何看待云数据库的变革趋势
Uniapp to preview pictures (single / multiple)
Navicat Premium 15 for Mac(数据库开发工具)中文版
Notes: lbcf: a Large Scale budget Constrained causal Forest Algorithm
JVM內存結構
JVM memory structure
Day_ fourteen
Reading mysql45 lecture - index continued
Deadlock, thread communication, singleton mode
居家办公让我绩效拿了C | 社区征文
et al和etc区别
Creating a uniapp project using hbuilder x
Resolve the format conflict between formatted document and eslint
mac php多版本管理以及安装swoole扩展
A TDD example
Detailed explanation of IVX low code platform series -- Overview (I)









