now the result of the response is {}
the Controller layer code is as follows
@JsonView(MyVo.MySimpleView.class)
public ResultBody getMyDetail(@PathVariable Integer userId) {
MyVo myVo = myPageService.getMyDetailByUserId(userId);
return ResultBody.success(myVo);
}
ResultBody structure
@Data
@ApiModel("(ResultBody)")
public class ResultBody {
@ApiModelProperty(value = "")
private int code;
@ApiModelProperty(value = "")
private String message;
@ApiModelProperty(value = "")
private Object result;
public ResultBody(ResultInfoInterface errorInfo) {
this.code = errorInfo.getCode();
this.message = errorInfo.getMessage();
}
public ResultBody(Object result) {
this.code = GlobalErrorInfoEnum.SUCCESS.getCode();
this.message = GlobalErrorInfoEnum.SUCCESS.getMessage();
this.result = result;
}
public ResultBody(ResultInfoInterface errorInfo, Object result) {
this.code = errorInfo.getCode();
this.message = errorInfo.getMessage();
this.result = result;
}
}
POJO structure is as follows
@Builder
@Data
public class MyVo {
public interface MySimpleView {
}
public interface MyDetailView extends MySimpleView {
}
/**
* XXXXXX
*/
private BigDecimal totalAssets;
@JsonView(MySimpleView.class)
public BigDecimal getTotalAssets() {
if (totalAssets == null) {
totalAssets = BigDecimalUtil.add(getBookBalance(), getUncollectedCapital());
}
return totalAssets;
}
}