serv-资源修改

This commit is contained in:
2025-10-20 15:08:20 +08:00
parent 2f1835bdbf
commit 16824537d1
50 changed files with 2657 additions and 353 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}