liulin
2024-07-30 9509af69aff71aeb1f3b62f766e124d291c3f374
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);
        }
    }
}