jinpengyong
2021-07-02 a437e96b9c1419cac50e6ea0bb65ff0352057e04
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
package com.moral.util;
 
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
 
import java.util.List;
 
/**
 * 分页工具类
 */
@Data
@ApiModel("分页数据封装类")
public class PageResult<T> {
 
    @ApiModelProperty("总条数")
    private Long total;
    @ApiModelProperty("总页数")
    private Long totalPage;
    @ApiModelProperty("当前页数据")
    private List<T> items;
    public PageResult(Long total, List<T> items) {
        this.total = total;
        this.items = items;
    }
 
    public PageResult(Long total, Long totalPage, List<T> items) {
        this.total = total;
        this.totalPage = totalPage;
        this.items = items;
    }
 
 
}