接口的形参为 User 实体对象示例:
@Data@NoArgsConstructor@AllArgsConstructor@ApiModel(value = "https://www.huyubaike.com/biancheng/User 对象",description = "?户/买家信息")public class User { @ApiModelProperty(dataType = "int",required = false)private int userId;@ApiModelProperty(dataType = "String",required = true, value = "https://www.huyubaike.com/biancheng/?户注册账号")private String userName;@ApiModelProperty(dataType = "String",required = true, value = "https://www.huyubaike.com/biancheng/?户注册密码")private String userPwd;@ApiModelProperty(dataType = "String",required = true, value = "https://www.huyubaike.com/biancheng/?户真实姓名")private String userRealname;@ApiModelProperty(dataType = "String",required = true, value = "https://www.huyubaike.com/biancheng/?户头像url")private String userImg;}
@ApiIgnore
:接??法注解,添加此注解的?法将不会?成到接??档中发现一个规律,越学到最后,越是有惊喜,有不有?swagger-ui 插件是一款 UI 美化插件,是基于 swagger 的 。
之前使用的默认 swagger 文档和调试页面如果使用起来不太顺畅 , 可以试试这款 swagger-ui 插件 。
使用
- 添加依赖
<dependency><groupId>com.github.xiaoymin</groupId><artifactId>swagger-bootstrap-ui</artifactId><version>1.9.6</version></dependency>
- 【Spring Boot 中使用 Swagger】重启 SpringBoot 应用,访问
http://localhost:8080/doc.html
效果如下:
文章插图
文章插图
文章插图
推荐阅读
- 原神坎蒂丝技能是什么
- 梦幻模拟战壳中少女技能是什么
- 原神3.0新敌人有哪些
- 嘉年华官方网站|嘉年华邮购中心
- 《英雄联盟》游戏中“烬”的大招怎么放(英雄联盟烬开大怎么取消)
- DNF极限的祭坛中木乃伊莫尼亚怎么打不死
- springboot整合项目-商城个人头像上传功能
- Spring三级缓存解决循环依赖
- 原神死域怎怎么清除
- 原神赛诺技能强度如何