File tree 1 file changed +6
-20
lines changed
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/query
1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change 47
47
public class PageQuery extends SortQuery {
48
48
49
49
private static final long serialVersionUID = 1L ;
50
+ /** 默认页码:1 */
51
+ private static final int DEFAULT_PAGE = 1 ;
52
+ /** 默认每页条数:10 */
53
+ private static final int DEFAULT_SIZE = 10 ;
50
54
51
55
/**
52
56
* 页码
53
57
*/
54
58
@ Schema (description = "页码" )
55
59
@ Min (value = 1 , message = "页码最小值为 {value}" )
56
- private Integer page ;
60
+ private Integer page = DEFAULT_PAGE ;
57
61
58
62
/**
59
63
* 每页条数
60
64
*/
61
65
@ Schema (description = "每页条数" )
62
66
@ Range (min = 1 , max = 1000 , message = "每页条数(取值范围 {min}-{max})" )
63
- private Integer size ;
64
-
65
- /** 默认页码:1 */
66
- private static final int DEFAULT_PAGE = 1 ;
67
- /** 默认每页条数:10 */
68
- private static final int DEFAULT_SIZE = 10 ;
69
-
70
- public PageQuery (Integer page , Integer size ) {
71
- this .setPage (page );
72
- this .setSize (size );
73
- }
67
+ private Integer size = DEFAULT_SIZE ;
74
68
75
69
/**
76
70
* 基于分页查询条件转换为 MyBatis Plus 分页条件
@@ -92,12 +86,4 @@ public <T> IPage<T> toPage() {
92
86
}
93
87
return mybatisPage ;
94
88
}
95
-
96
- public void setPage (Integer page ) {
97
- this .page = page == null ? DEFAULT_PAGE : page ;
98
- }
99
-
100
- public void setSize (Integer size ) {
101
- this .size = size == null ? DEFAULT_SIZE : size ;
102
- }
103
89
}
You can’t perform that action at this time.
0 commit comments