输入正文
public class R extends HashMap<String,Object> {
public R(){
put("code", HttpStatus.SC_OK);
put("msg","success");
}上面的put方法,还有下面的 return error方法,理论上好像应该是要new 一个R对象才能调用啊
public static R error(int code,String msg){
R r=new R();
r.put("code",code);
r.put("msg",msg);
return r;
}
public static R error(String msg){
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR,msg);
}搜索
复制