Java 招摇过市-如何为DTO中的int设置默认值0
我的代码:Java 招摇过市-如何为DTO中的int设置默认值0,java,json,swagger,dto,Java,Json,Swagger,Dto,我的代码: @ApiModelProperty(required = true, value = "") @JsonProperty(value="id") public int getWareHouseID() { return wareHouseID; } public void setWareHouseID(int wareHouseID) { this.wareHouseID = wareHouseID; } @ApiModelProperty(required =
@ApiModelProperty(required = true, value = "")
@JsonProperty(value="id")
public int getWareHouseID() {
return wareHouseID;
}
public void setWareHouseID(int wareHouseID) {
this.wareHouseID = wareHouseID;
}
@ApiModelProperty(required = true, value = "")
@JsonProperty(value="pId")
public int getParentID() {
return parentID;
}
public void setParentID(int parentID) {
this.parentID = parentID;
}
招摇过市的结果:
{
名称:string,
仓库ID:int,
公司名称:string,
全名:string,
地址:string,
父ID:int
}
我的问题:为什么int的结果是String?如何设置默认值为:0
谢谢大家。您好,看起来warehouseID和parentID都是正确的类型。您可以分享更多关于您的版本以及如何集成的信息吗?您还可以使用注释中的example属性设置示例值。您好@fehguy,我解决了我的问题。Tks 4回复!