AjaxResult重写put方法,以方便链式调用

This commit is contained in:
liuxing 2020-09-19 11:40:19 +08:00
parent 0023c2a5c3
commit 3eac5e93f8
1 changed files with 25 additions and 12 deletions

View File

@ -179,4 +179,17 @@ public class AjaxResult extends HashMap<String, Object>
{ {
return new AjaxResult(Type.ERROR, msg, data); return new AjaxResult(Type.ERROR, msg, data);
} }
/**
* 方便链式调用
*
* @param key
* @param value
* @return
*/
@Override
public AjaxResult put(String key, Object value) {
super.put(key, value);
return this;
}
} }