@ApiModelProperty(value = "登录账号")哪个属性决定备注
时间: 2023-07-26 11:45:43 浏览: 55
@ApiModelProperty注解中的value属性用于描述该属性的说明信息,通常用于生成API文档。可以将该属性的说明信息填写其中,例如:
```
@ApiModelProperty(value = "登录账号,长度不超过20个字符")
private String username;
```
其中的"value"属性值为登录账号的说明信息,可以在生成API文档时显示。如果需要进一步补充备注信息,可以在注解中添加notes属性,例如:
```
@ApiModelProperty(value = "登录账号", notes = "账号为必填项,长度不超过20个字符")
private String username;
```
其中的"notes"属性值为备注信息,可以在API文档中显示。
相关问题
记住这个实体 @ApiModel(value = "GoodsExplosive对象", description = "爆品福利表") public class GoodsExplosive extends Model<GoodsExplosive> { @TableId(value = "id", type = IdType.AUTO) private Integer id; @ApiModelProperty(value = "服务点编号") private Integer orgId; @ApiModelProperty(value = "基础商品id") private Integer goodsItemId; @ApiModelProperty(value = "商品标签id") private Integer goodsCategoriesId; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "商品图片") private String goodsPhotos; @ApiModelProperty(value = "商品属性") private Integer goodsValueId; @ApiModelProperty(value = "起购量(默认为1)") private Integer initialNumber; @ApiModelProperty(value = "限购量(默认为1)") private Integer restrictionNumber; @ApiModelProperty(value = "上架状态 0:未申请; 1:申请中; 2:审核通过 3:审核未通过4:已被下架 5平台强制下架") private Integer groundingState; }
这是一个Java实体类,使用了MyBatis-Plus框架的注解,表示了一个名为GoodsExplosive的对象,描述了爆品福利表的结构,其中包括id、orgId、goodsItemId等属性。其中,@ApiModelProperty注解用于描述该属性在API文档中的含义,@TableId注解表示该属性为表的主键,@IdType.AUTO表示自动递增。
@Data public class StorageLocationVo extends StorageLocation { @ApiModelProperty(value = "货架名") private String shelfName; private String type; private Integer sectionNum; private Integer layerNum; } @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("t_storage_location") @ApiModel(value="StorageLocation对象", description="储位表") public class StorageLocation implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "ID") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "储位名称") private String name; @ApiModelProperty(value = "储位编码") private String code; @ApiModelProperty(value = "库房id") private Long storeroomId; @ApiModelProperty(value = "站点id") private Long siteId; @ApiModelProperty(value = "识别编码") private String identifyCode; @ApiModelProperty(value = "货架id") private Long shelfId; @ApiModelProperty(value = "是否删除 0:正常 1:删除") @TableLogic private String isDelete; @ApiModelProperty(value = "创建时间") @TableField(fill = FieldFill.INSERT) private Date createTime; @ApiModelProperty(value = "更新时间") @TableField(fill = FieldFill.UPDATE) private Date updateTime; @ApiModelProperty(value = "所属站点名称") @TableField(exist = false) private String siteName; @ApiModelProperty(value = "所属库房名称") @TableField(exist = false) private String storeroomName; @ApiModelProperty(value = "所属货架名称") @TableField(exist = false) private String shelfName; @ApiModelProperty(value = "所属货架编码类型") @TableField(exist = false) private String codeRule; @ApiModelProperty(value = "所属货架节数") @TableField(exist = false) private Integer sectionNum; @ApiModelProperty(value = "所属货架层数") @TableField(exist = false) private Integer layerNum; } 分析一下为什么报java: com.tuimi.gwznkf.storage.entity.vo.StorageLocationVo中的setShelfName(java.lang.String)无法覆盖com.tuimi.gwznkf.storage.entity.StorageLocation中的setShelfName(java.lang.String) 返回类型void与com.tuimi.gwznkf.storage.entity.StorageLocation不兼容 问题解决
这个问题是由于在子类StorageLocationVo中定义了一个与父类StorageLocation中同名的属性shelfName,并且使用了@Data注解,自动生成了一个setShelfName方法,但是返回类型不同导致的。
解决该问题有两种方法:
1. 删除子类StorageLocationVo中的属性shelfName,因为父类中已经定义了该属性,所以不需要在子类中再定义一次。
2. 在子类StorageLocationVo中重新定义setShelfName方法,并且保证方法签名(包括返回类型、方法名和参数列表)与父类中的方法一致。可以使用@Override注解来表示该方法是对父类方法的重写。例如:
```
@Override
public void setShelfName(String shelfName) {
super.setShelfName(shelfName);
// 子类自定义的操作
}
```
需要注意的是,在子类中重写父类方法时,应该先调用父类的方法,再进行子类自己的操作,以保证方法的正确性。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)