Commit 3f939d39 by wangjf

fix page

parent 7bc72ca8
No preview for this file type
...@@ -87,7 +87,7 @@ public class ResultController { ...@@ -87,7 +87,7 @@ public class ResultController {
@ResponseBody @ResponseBody
public PageUtil list(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username, @RequestBody Query query) public PageUtil list(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username, @RequestBody Query query)
throws IOException { throws IOException {
PageHelper.startPage(query.getOffset() + 1, query.getLimit()); PageHelper.startPage(query.getOffset() / 10 + 1, query.getLimit());
List<TagResult> results = resultService.list(username); List<TagResult> results = resultService.list(username);
int total = resultDao.count(username); int total = resultDao.count(username);
PageUtil pageUtil = new PageUtil(results, total); PageUtil pageUtil = new PageUtil(results, total);
......
...@@ -140,7 +140,7 @@ public class TagController { ...@@ -140,7 +140,7 @@ public class TagController {
@ResponseBody @ResponseBody
public PageUtil list(@RequestBody Query query, public PageUtil list(@RequestBody Query query,
@RequestParam(name = "tag", required = false, defaultValue = "0") int tag) { @RequestParam(name = "tag", required = false, defaultValue = "0") int tag) {
PageHelper.startPage(query.getOffset() + 1, query.getLimit()); PageHelper.startPage(query.getOffset() / 10 + 1, query.getLimit());
List<Tag> tags = tagDao.list(tag); List<Tag> tags = tagDao.list(tag);
int total = tagDao.count(tag); int total = tagDao.count(tag);
PageUtil pageUtil = new PageUtil(tags, total); PageUtil pageUtil = new PageUtil(tags, total);
......
...@@ -116,7 +116,7 @@ public class UserController { ...@@ -116,7 +116,7 @@ public class UserController {
@PostMapping("/user/list") @PostMapping("/user/list")
@ResponseBody @ResponseBody
public PageUtil list(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username, @RequestBody Query query) { public PageUtil list(@SessionAttribute(WebSecurityConfig.SESSION_KEY) String username, @RequestBody Query query) {
PageHelper.startPage(query.getOffset() + 1, query.getLimit()); PageHelper.startPage(query.getOffset() / 10 + 1, query.getLimit());
List<User> users = userDao.list(); List<User> users = userDao.list();
int total = userDao.count(); int total = userDao.count();
PageUtil pageUtil = new PageUtil(users, total); PageUtil pageUtil = new PageUtil(users, total);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment