完善swagger2测试案例
This commit is contained in:
@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain;
|
||||
import java.util.HashMap;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 操作消息提醒
|
||||
@ -85,7 +86,10 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
{
|
||||
super.put(CODE_TAG, type.value);
|
||||
super.put(MSG_TAG, msg);
|
||||
super.put(DATA_TAG, data);
|
||||
if (StringUtils.isNotNull(data))
|
||||
{
|
||||
super.put(DATA_TAG, data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,6 +102,16 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success("操作成功", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
@ -218,11 +232,9 @@ public class AjaxResult extends HashMap<String, Object>
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("code", getCode())
|
||||
.append("msg", getMsg())
|
||||
.append("data", getData())
|
||||
.toString();
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("code", getCode())
|
||||
.append("msg", getMsg()).append("data", getData()).toString();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user