In the process of stability governance, it was found that a Get method did not have corresponding properties, but when returning data to the frontend, it automatically generated a property to return to the frontend。
@Data
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor
@Builder
@ApiModel("库存返回结果")
@JsonIgnoreProperties(ignoreUnknown = true)
public class StockProduct {
@ApiModelProperty(name = "stockInfo", value = "库存")
private List<Stock> storeInfo;
public List<Stock> getStoreInfo2() {
List<Stock> result = new ArrayList<>();
return result;
}
}
Return data to the front-end
{
"storeInfo": [
{
}
],
"storeInfo2": [
{
}
]
}
Why is this?
I have seen that the compiled class file did not generate the storeInfo2 attribute