java 自己写分页

long current =1;
long size =100;
String currentOther = jsonObject.getStr("current");

if(StrUtil.isNotBlank(currentOther)){
//?:0或1个, *:0或多个, +:1或多个
Boolean strResult1 = currentOther.matches("^[-\\+]?([0-9]+\\.?)?[0-9]+$");
if(strResult1){
current = Long.valueOf(currentOther);
}
}
String sizeOther = jsonObject.getStr("size");
if(StrUtil.isNotBlank(sizeOther)){
//?:0或1个, *:0或多个, +:1或多个
Boolean strResult1 = sizeOther.matches("^[-\\+]?([0-9]+\\.?)?[0-9]+$");
if(strResult1){
size = Long.valueOf(sizeOther);
}

}
OdpsJtjYxqzPageVO vo = new OdpsJtjYxqzPageVO();
vo.setSize(size);
vo.setCurrent((current-1)*size);
posted @ 2023-06-05 11:10  全琪俊  阅读(55)  评论(0编辑  收藏  举报