forked from kidgrow-microservices-platform

zhaoxiaohao
2020-08-17 73d5561cbf2bea50acc22f91050fcc3557d49de4
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
package com.kidgrow.common.model;
 
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.kidgrow.common.constant.CommonConstant;
 
import java.io.Serializable;
 
/**
 * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
 *
 * @Description: DTO基类<br>
 * @Project: <br>
 * @CreateDate: Created in 2020/2/3 16:15 <br>
 * @Author: <a href="4345453@kidgrow.com">liuke</a>
 */
public class SuperDto implements Serializable {
    private static final long serialVersionUID = 8575415936281850634L;
 
    public SuperDto() {
        this(1, CommonConstant.DEFAULT_PAGE_SIZE);
    }
 
    public SuperDto(Integer page, Integer limit) {
        this.page = page;
        this.limit = limit;
    }
 
    /**
     * 页号
     */
    private Integer page;
    /**
     * 分页大小
     */
    private Integer limit;
 
    @JsonIgnore
    public Integer getPage() {
        if (page == null || page < 1) {
            return 1;
        }
        return page;
    }
 
    public void setPage(Integer page) {
 
        if (page != null && page < 1) {
            this.page = 1;
        }
        this.page = page;
    }
 
    @JsonIgnore
    public Integer getLimit() {
        if (limit == null || limit < 1) {
            return 1;
        }
        return limit;
    }
 
    public void setLimit(Integer limit) {
 
        if (limit != null && limit < 1) {
            this.limit = 1;
        }
        this.limit = limit;
    }
}