查询返回列表数据,增加页码参数,如"pageNum": 1

This commit is contained in:
zhuangyuanke 2024-06-28 17:13:06 +08:00
parent 64b23966ef
commit 2cffc95a53
2 changed files with 11 additions and 1 deletions

View File

@ -78,6 +78,8 @@ public class BaseController {
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(list);
// 返回 页码
rspData.setPageNum(new PageInfo(list).getPageNum());
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}

View File

@ -15,7 +15,10 @@ public class TableDataInfo implements Serializable {
* 总记录数
*/
private long total;
/**
* 页码
*/
private long pagenum;
/**
* 列表数据
*/
@ -56,6 +59,11 @@ public class TableDataInfo implements Serializable {
this.total = total;
}
public long getPageNum(){return pagenum;}
public void setPageNum(long pn){ this.pagenum = pn;}
public List<?> getRows() {
return rows;
}