package com.dsh.course.util;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import org.springframework.util.StringUtils;
|
|
|
/**
|
* BootStrap Table默认的分页参数创建
|
*
|
* @author fengshuonan
|
* @date 2017-04-05 22:25
|
*/
|
public class PageFactory<T> {
|
|
|
public Page<T> defaultPage(Integer limit, Integer offset, String sort, String order) {
|
if (StringUtils.isEmpty(sort)) {
|
Page<T> page = new Page<>((offset / limit + 1), limit);
|
return page;
|
} else {
|
Page<T> page = new Page<T>((offset / limit + 1), limit);
|
if ("asc".equals(order)) {
|
} else {
|
}
|
return page;
|
}
|
}
|
}
|