PageInfo.java 824 Bytes
package com.pashanhoo.common;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class PageInfo {
    @ApiModelProperty(name = "currentPage",value = "页码")
    private Integer currentPage = 1;

    @ApiModelProperty(name = "pageSize",value = "每页个数")
    private Integer pageSize = 10;

    @ApiModelProperty(name = "sortField",value = "排序字段" )
    private String sortField;

    @ApiModelProperty(name = "sortOrder",value = "升序(asc)或降序(desc)")
    private String sortOrder;

    public void defaultFillPageProp(String sortField, String sortOrder) {
        if(StringUtils.isBlank(this.sortField)) {
            this.sortField = sortField;
            this.sortOrder = sortOrder;
        }
    }
}