mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-03 07:56:38 +00:00
上传后台管理系统代码
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
package com.java2nb.common.utils;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
public class Query extends LinkedHashMap<String, Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//
|
||||
private int offset;
|
||||
// 每页条数
|
||||
private int limit;
|
||||
|
||||
public Query(Map<String, Object> params) {
|
||||
this.putAll(params);
|
||||
// 分页参数
|
||||
this.offset = Integer.parseInt(params.get("offset").toString());
|
||||
this.limit = Integer.parseInt(params.get("limit").toString());
|
||||
this.put("offset", offset);
|
||||
this.put("page", offset / limit + 1);
|
||||
this.put("limit", limit);
|
||||
}
|
||||
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(int offset) {
|
||||
this.put("offset", offset);
|
||||
}
|
||||
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(int limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user