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

This commit is contained in:
RuoYi 2021-10-22 16:23:08 +08:00
parent d3696f5223
commit 3dbbc6a223
1 changed files with 13 additions and 11 deletions

View File

@ -146,15 +146,17 @@ public class AjaxResult extends HashMap<String, Object>
return new AjaxResult(code, msg, null); return new AjaxResult(code, msg, null);
} }
/** /**
* 链式调用 * 方便链式调用
* *
* @param key * @param key
* @param value 内容 * @param value
* @return 警告消息 * @return 数据对象
*/ */
public AjaxResult put(String key, Object value) { @Override
super.put(key, value); public AjaxResult put(String key, Object value)
return this; {
} super.put(key, value);
return this;
}
} }