zxl
2025-05-16 1e4fce87e08f4a00c76cac14286d8c2c99e3cba0
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
package cn.lili.common.vo;
 
import cn.hutool.core.text.CharSequenceUtil;
import cn.lili.common.utils.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
 
import java.io.Serializable;
 
/**
 * 查询参数
 *
 * @author Chopper
 */
@Data
public class PageVO implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    @ApiModelProperty(value = "页号")
    private Integer pageNumber = 1;
 
    @ApiModelProperty(value = "页面大小")
    private Integer pageSize = 10;
 
    @ApiModelProperty(value = "排序字段")
    private String sort;
 
    @ApiModelProperty(value = "排序方式 asc/desc")
    private String order;
 
    @ApiModelProperty(value = "需要驼峰转换蛇形", notes = "一般不做处理,如果数据库中就是蛇形,则这块需要处理。")
    private Boolean notConvert;
 
    public String getSort() {
        if (CharSequenceUtil.isNotEmpty(sort)) {
            if (notConvert == null || Boolean.FALSE.equals(notConvert)) {
                return StringUtils.camel2Underline(sort);
            } else {
                return sort;
            }
        }
        return sort;
    }
 
}