提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.framework.common.pojo; |
H |
2 |
|
|
3 |
import io.swagger.v3.oas.annotations.media.Schema; |
|
4 |
import lombok.Data; |
|
5 |
|
|
6 |
import javax.validation.constraints.Min; |
|
7 |
import javax.validation.constraints.Max; |
|
8 |
import javax.validation.constraints.NotNull; |
|
9 |
import java.io.Serializable; |
|
10 |
|
|
11 |
@Schema(description="分页参数") |
|
12 |
@Data |
|
13 |
public class PageParam implements Serializable { |
|
14 |
|
|
15 |
private static final Integer PAGE_NO = 1; |
|
16 |
private static final Integer PAGE_SIZE = 10; |
|
17 |
|
|
18 |
/** |
|
19 |
* 每页条数 - 不分页 |
|
20 |
* |
|
21 |
* 例如说,导出接口,可以设置 {@link #pageSize} 为 -1 不分页,查询所有数据。 |
|
22 |
*/ |
|
23 |
public static final Integer PAGE_SIZE_NONE = -1; |
|
24 |
|
|
25 |
@Schema(description = "页码,从 1 开始", requiredMode = Schema.RequiredMode.REQUIRED,example = "1") |
|
26 |
@NotNull(message = "页码不能为空") |
|
27 |
@Min(value = 1, message = "页码最小值为 1") |
|
28 |
private Integer pageNo = PAGE_NO; |
|
29 |
|
|
30 |
@Schema(description = "每页条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
|
31 |
@NotNull(message = "每页条数不能为空") |
|
32 |
@Min(value = 1, message = "每页条数最小值为 1") |
|
33 |
@Max(value = 100, message = "每页条数最大值为 100") |
|
34 |
private Integer pageSize = PAGE_SIZE; |
|
35 |
|
|
36 |
} |