jyy
2021-06-19 756e16e090b15c7fd8648f55f5451367face6abc
zq-erp/src/main/java/com/matrix/core/pojo/AjaxResult.java
@@ -4,7 +4,7 @@
import com.matrix.core.tools.InternationaUtil;
import com.matrix.core.tools.MdcUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.hive.plugin.message.StringUtil;
import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo;
import java.io.Serializable;
import java.util.HashMap;
@@ -44,7 +44,14 @@
     * info会被国际化工具先处理,找不到国际化资源则显示原始信息
     **/
    private String info;
    /**
     * 单个对象返回参数
     */
    private Object data;
    private Map<Object, Object> mapInfo = new HashMap<>();
    private List<?> rows;
    /**
     * 总记录数
@@ -53,8 +60,17 @@
    private String requestId;
    public static AjaxResult buildSuccessInstance(Object data) {
        AjaxResult result= new AjaxResult(STATUS_SUCCESS,"");
        result.data=data;
        return  result;
    }
    public static AjaxResult buildSuccessInstance(Object data, String info) {
        AjaxResult result= new AjaxResult(STATUS_SUCCESS,info);
        result.data=data;
        return  result;
    }
    public static AjaxResult buildSuccessInstance(String info) {
@@ -69,6 +85,11 @@
    public static AjaxResult buildSuccessInstance(List<?> rows, Integer total) {
        return new AjaxResult(STATUS_SUCCESS, rows, total);
    }
    public static AjaxResult buildSuccessInstance(List<?> rows, long total) {
        return new AjaxResult(STATUS_SUCCESS, rows, Integer.parseInt(total+""));
    }
    public static AjaxResult buildSuccessInstance(List<?> rows) {
        return new AjaxResult(STATUS_SUCCESS, rows);
@@ -93,8 +114,6 @@
     * 设置简单信息,这是一个便捷的方法
     *
     * @param status
     * @param page
     * @param info
     */
    public AjaxResult(String status, List<?> rows) {
        this.status = status;
@@ -109,6 +128,7 @@
        }
        this.requestId= MdcUtil.getMdc();
    }
@@ -168,6 +188,14 @@
        this.requestId = requestId;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    /**
     * 在map对象中放置信息
     *