| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class TableDataInfo<T> implements Serializable { |
| | |
| | | public TableDataInfo(List<T> list, long total) { |
| | | this.rows = list; |
| | | this.total = total; |
| | | this.code = HttpStatus.HTTP_OK; |
| | | this.msg = "查询成功"; |
| | | } |
| | | |
| | | /** |
| | | * 根据分页对象构建表格分页数据对象 |
| | | */ |
| | | public static <T> TableDataInfo<T> build(IPage<T> page) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 根据数据列表构建表格分页数据对象 |
| | | */ |
| | | public static <T> TableDataInfo<T> build(List<T> list) { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |
| | |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * 构建表格分页数据对象 |
| | | */ |
| | | public static <T> TableDataInfo<T> build() { |
| | | TableDataInfo<T> rspData = new TableDataInfo<>(); |
| | | rspData.setCode(HttpStatus.HTTP_OK); |