|
|
@@ -94,7 +94,7 @@ public class UserController extends BaseController {
|
|
|
* @exception
|
|
|
* @since 1.0.0
|
|
|
*/
|
|
|
- @RequestMapping(value = "/updateUser/{userid}",method=RequestMethod.POST,produces="application/json;charset=UTF-8")
|
|
|
+ @RequestMapping(value = "/updateUser/{userid}",method=RequestMethod.PUT,produces="application/json;charset=UTF-8")
|
|
|
public String updateUser(@RequestBody User user,@PathVariable int userid){
|
|
|
try{
|
|
|
user.setId(userid);
|
|
|
@@ -123,7 +123,12 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取所用用户
|
|
|
+ * @param page
|
|
|
+ * @param size
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@PreAuthorize("hasRole('ADMIN')")
|
|
|
@RequestMapping(value = "/get/all/{page}/{size}",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
|
|
|
@@ -138,6 +143,19 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
+ @RequestMapping(value = "/get/list/{page}/{size}",method=RequestMethod.POST,produces="application/json;charset=UTF-8")
|
|
|
+ public String getUsers(@PathVariable Integer page,@PathVariable Integer size,@RequestBody User user){
|
|
|
+ try{
|
|
|
+ PageHelper.startPage(page, size);
|
|
|
+ List<User> users= userService.getUsers(user);
|
|
|
+
|
|
|
+ return returnResult(0, "获取成功", new PageInfo(users));
|
|
|
+ }catch(Exception e){
|
|
|
+ throw new BusinessException(20001);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|