同学你好,1、建议同学查看是否有调用对应的类设置返回值。如下所示:
2、ResponseUtils类中属性名错误,并get/set方法与属性名没有对应,则建议同学进行修改。如下所示:
package com.imooc.reader.utils;
import java.util.LinkedHashMap;
import java.util.Map;
public class ResponseUtils {
private String code;
private String message;
private Map data = new LinkedHashMap<>();
public ResponseUtils(){
this.code = "0";
this.message = "success";
}
public ResponseUtils(String code , String message){
this.code = code;
this.message = message;
}
public ResponseUtils put(String key , Object value){
this.data.put(key, value);
return this;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Map getData() {
return data;
}
public void setData(Map data) {
this.data = data;
}
}
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星