UserMgrController.java
2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser;
import com.glsx.service.UserMgrService;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "/usermgr")
public class UserMgrController {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(UserMgrController.class);
@Autowired
private UserMgrService userMgrService;
@RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<PlatformUser> getUserMgrList(Pagination pagination) {
ResponseEntity<PlatformUser> responseEntity = new ResponseEntity<>();
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformUser> datasyncAnjVerifyAccountsList = userMgrService.getUserMgrList();
long total = ((Page<PlatformUser>) datasyncAnjVerifyAccountsList).getTotal();
responseEntity.setData(datasyncAnjVerifyAccountsList);
responseEntity.setRecordsTotal(total);
responseEntity.setRecordsFiltered(total);
return responseEntity;
}
@RequestMapping(value = "/reset", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<PlatformUser> reset(Pagination pagination) {
ResponseEntity<PlatformUser> responseEntity = new ResponseEntity<>();
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformUser> datasyncAnjVerifyAccountsList = userMgrService.getUserMgrList();
long total = ((Page<PlatformUser>) datasyncAnjVerifyAccountsList).getTotal();
responseEntity.setData(datasyncAnjVerifyAccountsList);
responseEntity.setRecordsTotal(total);
responseEntity.setRecordsFiltered(total);
return responseEntity;
}
}