提交 | 用户 | 时间
|
a6de49
|
1 |
/** |
H |
2 |
* Copyright (c) 2018 人人开源 All rights reserved. |
|
3 |
* |
|
4 |
* https://www.renren.io |
|
5 |
* |
|
6 |
* 版权所有,侵权必究! |
|
7 |
*/ |
|
8 |
|
|
9 |
package com.iailab.framework.common.page; |
|
10 |
|
|
11 |
import io.swagger.v3.oas.annotations.media.Schema; |
|
12 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
13 |
import lombok.Data; |
|
14 |
|
|
15 |
import java.io.Serializable; |
|
16 |
import java.util.List; |
|
17 |
|
|
18 |
/** |
|
19 |
* 分页工具类 |
|
20 |
* |
|
21 |
* @author Mark sunlightcs@gmail.com |
|
22 |
*/ |
|
23 |
@Data |
|
24 |
@Tag(name = "分页数据") |
|
25 |
public class PageData<T> implements Serializable { |
|
26 |
private static final long serialVersionUID = 1L; |
|
27 |
|
|
28 |
@Schema(description = "总记录数") |
|
29 |
private int total; |
|
30 |
|
|
31 |
@Schema(description = "列表数据") |
|
32 |
private List<T> list; |
|
33 |
|
|
34 |
/** |
|
35 |
* 分页 |
|
36 |
* @param list 列表数据 |
|
37 |
* @param total 总记录数 |
|
38 |
*/ |
|
39 |
public PageData(List<T> list, long total) { |
|
40 |
this.list = list; |
|
41 |
this.total = (int)total; |
|
42 |
} |
|
43 |
} |