| | |
| | | @PreAuthorize("hasRole('ROLE_admin')") |
| | | public ResultVO<String> addUser(Authentication authentication, @RequestBody AccountAddRPCReqDTO accountAddRPCReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.addAccount(currentUser.getUid(), accountAddRPCReqDTO); |
| | | return accountUserService.addAccount(currentUser, accountAddRPCReqDTO); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/mod", method = RequestMethod.POST) |
| | | @PreAuthorize("hasRole('ROLE_admin')") |
| | | public ResultVO<String> modUser(Principal principal, @RequestBody AccountModRPCReqDTO accountModRPCReqDTO) { |
| | | String userId = principal.getName(); |
| | | return accountUserService.modAccount(Long.valueOf(userId), accountModRPCReqDTO); |
| | | public ResultVO<String> modUser(Authentication authentication, @RequestBody AccountModRPCReqDTO accountModRPCReqDTO) { |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.modAccount(currentUser, accountModRPCReqDTO); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/del", method = RequestMethod.POST) |
| | | @PreAuthorize("hasRole('ROLE_admin')") |
| | | public ResultVO<String> delUser(Principal principal, @RequestBody JSONObject json) { |
| | | public ResultVO<String> delUser(Authentication authentication, @RequestBody JSONObject json) { |
| | | Long uid = json.getLong("uid"); |
| | | String userId = principal.getName(); |
| | | return accountUserService.delAccount(Long.valueOf(userId), uid); |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return accountUserService.delAccount(currentUser, uid); |
| | | } |
| | | } |