PageResponseVO.java
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.yohoufo.user.responseVO;
import java.util.List;
/**
* Created by shengguo.cai on 2018/9/12.
*/
public class PageResponseVO<T> {
/**
* 总记录数
*/
private int total;
/**
* 当前页
*/
private int page;
/**
* 每页记录数
*/
private int size;
/**
* 总页数
*/
private int totalPage;
/**
* 数据
*/
private List<T> list;
public PageResponseVO() {
}
public int getTotal() {
return this.total;
}
public void setTotal(int total) {
this.total = total;
this.dealTotalPage();
}
private void dealTotalPage() {
if (this.total > 0 && this.size > 0) {
int totalPage = this.total % this.size == 0 ? this.total / this.size : this.total / this.size + 1;
this.setTotalPage(totalPage);
}
}
public int getPage() {
return this.page;
}
public void setPage(int page) {
this.page = page;
}
public List<T> getList() {
return this.list;
}
public void setList(List<T> list) {
this.list = list;
}
public int getSize() {
return this.size;
}
public void setSize(int size) {
this.size = size;
this.dealTotalPage();
}
public int getTotalPage() {
return this.totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
}