serv-资源修改
This commit is contained in:
@@ -40,16 +40,25 @@ public class PageParam implements Serializable {
|
||||
*/
|
||||
private long totalElements;
|
||||
|
||||
/**
|
||||
* @description 偏移量
|
||||
* @author yslg
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
private long offset;
|
||||
|
||||
public PageParam() {
|
||||
this.pageNumber = 1;
|
||||
this.pageSize = 10;
|
||||
this.totalPages = 0;
|
||||
this.totalElements = 0;
|
||||
this.offset = 0;
|
||||
}
|
||||
|
||||
public PageParam(int pageNumber, int pageSize) {
|
||||
this.pageNumber = pageNumber;
|
||||
this.pageSize = pageSize;
|
||||
this.offset = (pageNumber - 1) * pageSize;
|
||||
}
|
||||
|
||||
public PageParam(int pageNumber, int pageSize, int totalPages, long totalElements) {
|
||||
@@ -57,6 +66,7 @@ public class PageParam implements Serializable {
|
||||
this.pageSize = pageSize;
|
||||
this.totalPages = totalPages;
|
||||
this.totalElements = totalElements;
|
||||
this.offset = (pageNumber - 1) * pageSize;
|
||||
}
|
||||
/**
|
||||
* @description 设置当前页码
|
||||
@@ -147,5 +157,24 @@ public class PageParam implements Serializable {
|
||||
return totalElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置偏移量
|
||||
* @param offset 偏移量
|
||||
* @return void
|
||||
* @author yslg
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
public void setOffset(long offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取偏移量
|
||||
* @return 偏移量
|
||||
* @author yslg
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
public long getOffset() {
|
||||
return offset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package org.xyzh.common.core.page;
|
||||
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
|
||||
/**
|
||||
* @description 分页查询请求
|
||||
* @filename PageRequest.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-20
|
||||
*/
|
||||
public class PageRequest<T> {
|
||||
|
||||
/**
|
||||
* 过滤条件
|
||||
*/
|
||||
private T filter;
|
||||
|
||||
/**
|
||||
* 分页参数
|
||||
*/
|
||||
private PageParam pageParam;
|
||||
|
||||
public T getFilter() {
|
||||
return filter;
|
||||
}
|
||||
|
||||
public void setFilter(T filter) {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public PageParam getPageParam() {
|
||||
return pageParam;
|
||||
}
|
||||
|
||||
public void setPageParam(PageParam pageParam) {
|
||||
this.pageParam = pageParam;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user