@ApiModelProperty用法

@ApiModelProperty()用于方法,字段; 表示对model属性的说明或者数据操作更改 
value–字段说明 
name–重写属性名字 
dataType–重写属性类型 
required–是否必填 
example–举例说明 
hidden–隐藏

复制代码
@ApiModel(value="user对象",description="用户对象user")
public class User implements Serializable{
    private static final long serialVersionUID = 1L;
     @ApiModelProperty(value="用户名",name="username",example="xingguo")
     private String username;
     @ApiModelProperty(value="状态",name="state",required=true)
      private Integer state;
      private String password;
      private String nickName;
      private Integer isDeleted;
  @ApiModelProperty(value</span>="id数组",hidden=<span style="color: #0000ff;">true</span><span style="color: #000000;">)
  </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> String[] ids;
  </span><span style="color: #0000ff;">private</span> List&lt;String&gt;<span style="color: #000000;"> idList;
 </span><span style="color: #008000;">//</span><span style="color: #008000;">省略get/set</span>

}

复制代码

原文地址:https://www.cnblogs.com/huanghuanghui/p/9086860.html

posted @ 2019-08-31 16:50  星朝  阅读(21417)  评论(0编辑  收藏  举报