All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lx.entity.PageDTO Maven / Gradle / Ivy

package com.lx.entity;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lx.annotation.Note;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;

/**
 * 分页入参父类
 *
 * @author ylx
 * @date 2020-06-12
 */
@Data
@Schema(name = "分页入参")
public class PageDTO implements Serializable {
    @Schema(description = "页数")
    @Min(value = 1, message = "第几页不能小于1")
    @NotNull(message = "页数不能为空")
    private Long page;

    @Schema(description = "每页条数")
    @Min(value = 1, message = "每页条数不能小于1")
    @NotNull(message = "每页条数不能为空")
    private Long limit;

    @Note("开始分页")
    public Page startPage(){
        return Page.of(getPage(), getLimit());
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy