public abstract class AbstractService<I extends Entity> {
protected static final int PAGE_SIZE_10 = 10;
public static final int BATCH_NUM = 100;
public static final int PAGE_SIZE_MAX = 860601;
/**
* github的PageHelper分页初始化
*
* @param e
*/
public void pageInit(Entity e) {
int ps = 0;
int pn = 0;
if (null != e) {
ps = null == e.getPageSize() ? 0 : e.getPageSize();
pn = null == e.getPageNum() ? 0 : e.getPageNum();
}
pn = pn == 0 ? 1 : pn;
if (!Constants.MV_PAGE_NUM.containsKey(ps) && ps != BATCH_NUM && ps != PAGE_SIZE_MAX && (ps <= 0 || ps > 20)) {
ps = PAGE_SIZE_10;
}
Page&