郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
87
88
89
90
91
92
package com.gkhy.safePlatform.commons.vo;
 
import com.gkhy.safePlatform.commons.enums.ResultCodes;
 
public class
SearchResultVO<T> extends ResultVO<T>{
 
    private boolean usePage;
 
    private Long total;
 
    private Long pages;
 
    private Long pageSize;
 
    private Long pageIndex;
 
 
    public SearchResultVO() {
    }
 
    public SearchResultVO(ResultCodes rcode) {
        this.code = rcode.getCode();
        this.setCount(0);
        this.setTotal(0L);
        if(this.msg == null || this.msg.isEmpty()){
            this.msg = rcode.getDesc();
        }
        this.usePage = false;
        this.setPageSize(10L);
        this.setPageIndex(1L);
        this.setTotal(0L);
    }
 
    public static SearchResultVO success(){
        SearchResultVO searchResultVO = new SearchResultVO();
        searchResultVO.setCode(ResultCodes.OK.getCode());
        return searchResultVO;
    }
 
    public SearchResultVO(boolean usePage,Long pageIndex, Long pageSize,Long pages, Long total ,T data,ResultCodes resultCode) {
        super(resultCode, data);
        this.usePage = usePage;
        this.total = total;
        this.pages = pages;
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
    }
 
 
 
 
    public boolean isUsePage() {
        return usePage;
    }
 
    public void setUsePage(boolean usePage) {
        this.usePage = usePage;
    }
 
    public Long getTotal() {
        return total;
    }
 
    public void setTotal(Long total) {
        this.total = total;
    }
 
    public Long getPageSize() {
        return pageSize;
    }
 
    public void setPageSize(Long pageSize) {
        this.pageSize = pageSize;
    }
 
    public Long getPageIndex() {
        return pageIndex;
    }
 
    public void setPageIndex(Long pageIndex) {
        this.pageIndex = pageIndex;
    }
 
    public Long getPages() {
        return pages;
    }
 
    public void setPages(Long pages) {
        this.pages = pages;
    }
}