mirror of https://gitee.com/y_project/RuoYi.git
Pre Merge pull request !518 from 长草颜团子/feature/page-feature
commit
d619775a64
|
@ -3,6 +3,7 @@ package com.ruoyi.common.core.controller;
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
@ -117,6 +118,18 @@ public class BaseController
|
||||||
return rspData;
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 响应请求分页数据
|
||||||
|
* @param supplier 待分页函数
|
||||||
|
* @return 分页结果
|
||||||
|
*/
|
||||||
|
protected TableDataInfo getDataTableByFunction(Supplier<List<?>> supplier)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
return getDataTable(supplier.get());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应返回结果
|
* 响应返回结果
|
||||||
*
|
*
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class TableDataInfo implements Serializable
|
public class TableDataInfo<T> implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class TableDataInfo implements Serializable
|
||||||
private long total;
|
private long total;
|
||||||
|
|
||||||
/** 列表数据 */
|
/** 列表数据 */
|
||||||
private List<?> rows;
|
private List<T> rows;
|
||||||
|
|
||||||
/** 消息状态码 */
|
/** 消息状态码 */
|
||||||
private int code;
|
private int code;
|
||||||
|
@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
|
||||||
* @param list 列表数据
|
* @param list 列表数据
|
||||||
* @param total 总记录数
|
* @param total 总记录数
|
||||||
*/
|
*/
|
||||||
public TableDataInfo(List<?> list, int total)
|
public TableDataInfo(List<T> list, int total)
|
||||||
{
|
{
|
||||||
this.rows = list;
|
this.rows = list;
|
||||||
this.total = total;
|
this.total = total;
|
||||||
|
@ -58,7 +58,7 @@ public class TableDataInfo implements Serializable
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRows(List<?> rows)
|
public void setRows(List<T> rows)
|
||||||
{
|
{
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue