| | |
| | | @ApiOperation(value = "用户注册") |
| | | @RequestMapping(value = "/register", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "添加用户") |
| | | @LogSave(operationType = "用户管理", contain = "添加用户") |
| | | public CommonResult<UmsAdmin> register(@Validated @RequestBody UmsAdminParam umsAdminParam) { |
| | | UmsAdmin umsAdmin = adminService.register(umsAdminParam); |
| | | if (umsAdmin == null) { |
| | |
| | | String username = principal.getName(); |
| | | UmsAdmin umsAdmin = adminService.getAdminByUsername(username); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("userId", umsAdmin.getId()); |
| | | data.put("username", umsAdmin.getUsername()); |
| | | data.put("menus", roleService.getMenuList(umsAdmin.getId())); |
| | | data.put("icon", umsAdmin.getIcon()); |
| | |
| | | @ApiOperation("修改指定用户信息") |
| | | @RequestMapping(value = "/update/{id}", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "修改用户") |
| | | @LogSave(operationType = "用户管理", contain = "修改用户") |
| | | public CommonResult update(@PathVariable Long id, @RequestBody UmsAdmin admin) { |
| | | boolean success = adminService.update(id, admin); |
| | | if (success) { |
| | |
| | | @ApiOperation("修改指定用户密码") |
| | | @RequestMapping(value = "/updatePassword", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "修改用户密码") |
| | | @LogSave(operationType = "用户管理", contain = "修改用户密码") |
| | | public CommonResult updatePassword(@Validated @RequestBody UpdateAdminPasswordParam updatePasswordParam) { |
| | | int status = adminService.updatePassword(updatePasswordParam); |
| | | if (status > 0) { |
| | |
| | | @ApiOperation("删除指定用户信息") |
| | | @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "删除用户") |
| | | @LogSave(operationType = "用户管理", contain = "删除用户") |
| | | public CommonResult delete(@PathVariable Long id) { |
| | | boolean success = adminService.delete(id); |
| | | if (success) { |
| | |
| | | @ApiOperation("修改帐号状态") |
| | | @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "用户账号启用/禁用") |
| | | @LogSave(operationType = "用户管理", contain = "用户账号启用/禁用") |
| | | public CommonResult updateStatus(@PathVariable Long id, @RequestParam(value = "status") Integer status) { |
| | | UmsAdmin umsAdmin = new UmsAdmin(); |
| | | umsAdmin.setStatus(status); |
| | |
| | | @ApiOperation("批量删除用户") |
| | | @RequestMapping(value = "/deleteBatch", method = RequestMethod.POST) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "用户Ids",required = true, dataType = "Array") |
| | | @ApiImplicitParam(name = "ids", value = "用户Ids", required = true, dataType = "Array") |
| | | }) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "批量删除用户") |
| | | @LogSave(operationType = "用户管理", contain = "批量删除用户") |
| | | public CommonResult deleteBatch(@RequestParam("ids") List<Long> ids) { |
| | | boolean success = adminService.deleteBatch(ids); |
| | | if (success) { |
| | |
| | | @ApiOperation("批量修改用户状态") |
| | | @RequestMapping(value = "/updateStatusBatch", method = RequestMethod.POST) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "用户Ids",required = true, dataType = "Array"), |
| | | @ApiImplicitParam(name = "status", value = "状态0->禁用;1->启用",required = true, dataType = "Integer") |
| | | @ApiImplicitParam(name = "ids", value = "用户Ids", required = true, dataType = "Array"), |
| | | @ApiImplicitParam(name = "status", value = "状态0->禁用;1->启用", required = true, dataType = "Integer") |
| | | }) |
| | | @ResponseBody |
| | | @LogSave(operationType = "用户管理",contain = "用户账号批量启用/禁用") |
| | | @LogSave(operationType = "用户管理", contain = "用户账号批量启用/禁用") |
| | | public CommonResult updateStatusBatch(@RequestParam("ids") List<Long> ids, @RequestParam(value = "status") Integer status) { |
| | | boolean success = adminService.updateStatusBatch(ids, status); |
| | | if (success) { |
| | |
| | | return CommonResult.failed(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取部门人员") |
| | | @RequestMapping(value = "/getDepartUser/{departId}", method = RequestMethod.GET) |
| | | @ResponseBody |
| | | public CommonResult<List<UmsAdmin>> getDepartUser(@PathVariable Long departId) { |
| | | return CommonResult.success(adminService.getDepartUser(departId)); |
| | | } |
| | | |
| | | } |
| | | } |