改为泛型

Signed-off-by: runphp <runphp@qq.com>
This commit is contained in:
runphp 2022-08-12 02:19:53 +00:00 committed by Gitee
parent 2a675aa304
commit d4b3b515d1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 4 deletions

View File

@ -59,14 +59,13 @@ public class BaseController
/** /**
* 响应请求分页数据 * 响应请求分页数据
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" }) protected <T> TableDataInfo<T> getDataTable(List<T> list)
protected TableDataInfo getDataTable(List<?> 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("查询成功");
rspData.setTotal(new PageInfo(list).getTotal()); rspData.setTotal(new PageInfo<>(list).getTotal());
return rspData; return rspData;
} }