liulin
2024-07-29 b65029f9d6e351a714682c110343a8c23eb4e793
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.lunhan.xxx.service;
 
import com.lunhan.xxx.common.ConstantFactory;
import com.lunhan.xxx.common.util.NumericUtil;
import com.lunhan.xxx.entity.dto.SearchBasicDTO;
 
public class BaseService {
    public void dealPager(SearchBasicDTO search) {
        if(NumericUtil.tryParseInt(search.getLimit()).compareTo(0) < 1) {
            search.setLimit(ConstantFactory.PAGE_SIZE_DEFAULT);
        }
        if(NumericUtil.tryParseInt(search.getPage()).compareTo(0) < 1) {
            search.setPage(1);
        }
    }
}