问题描述
org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return
- Result
@SuppressWarnings("all") | |
public class Result { | |
private Object data; | |
private Integer code; | |
private String msg; | |
public Result() { | |
} | |
public Result(Object data, Integer code) { | |
this.data = data; | |
this.code = code; | |
} | |
public Result(Object data, Integer code, String msg) { | |
this.data = data; | |
this.code = code; | |
this.msg = msg; | |
} | |
} |
问题原因:实体类缺少 getter,setter 方法
解决方案:重写 getter,setter 方法即可