Pre Merge pull request !256 from 云飞扬/N/A

This commit is contained in:
云飞扬 2022-10-28 13:03:09 +00:00 committed by Gitee
commit fdd3b88b8d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 13 additions and 13 deletions

View File

@ -16,7 +16,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
/** /**
* web层通用数据处理 * web层通用数据处理
* *
* @author ruoyi * @author ruoyi
*/ */
public class BaseController public class BaseController
@ -60,9 +60,9 @@ public class BaseController
* 响应请求分页数据 * 响应请求分页数据
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable(List<?> list) protected <T> TableDataInfo<T> getDataTable(List<T> list)
{ {
TableDataInfo rspData = new TableDataInfo(); TableDataInfo<T> rspData = new TableDataInfo<>();
rspData.setCode(HttpStatus.SUCCESS); rspData.setCode(HttpStatus.SUCCESS);
rspData.setRows(list); rspData.setRows(list);
rspData.setMsg("查询成功"); rspData.setMsg("查询成功");
@ -72,7 +72,7 @@ public class BaseController
/** /**
* 响应返回结果 * 响应返回结果
* *
* @param rows 影响行数 * @param rows 影响行数
* @return 操作结果 * @return 操作结果
*/ */
@ -83,7 +83,7 @@ public class BaseController
/** /**
* 响应返回结果 * 响应返回结果
* *
* @param result 结果 * @param result 结果
* @return 操作结果 * @return 操作结果
*/ */

View File

@ -5,10 +5,10 @@ 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;
@ -33,11 +33,11 @@ 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;
@ -53,12 +53,12 @@ public class TableDataInfo implements Serializable
this.total = total; this.total = total;
} }
public List<?> getRows() public List<T> getRows()
{ {
return rows; return rows;
} }
public void setRows(List<?> rows) public void setRows(List<T> rows)
{ {
this.rows = rows; this.rows = rows;
} }
@ -82,4 +82,4 @@ public class TableDataInfo implements Serializable
{ {
this.msg = msg; this.msg = msg;
} }
} }