| | |
| | | return R.status(result); |
| | | } |
| | | |
| | | /** |
| | | * 自定义用户列表(微信小程序注册用户数据和系统用户数据结构一致,库不同) |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId) { |
| | | IPage<UserVO> pages = userWxService.selectUserPage(Condition.getPage(query), user, deptId, (AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : AuthUtil.getTenantId())); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 用户详情 |
| | | * |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @GetMapping("/details") |
| | | public R details(User user) { |
| | | UserVO userInfo = userWxService.getUserDetailById(user.getId()); |
| | | if (null != userInfo.getFingerprint() && !userInfo.getFingerprint().equals("")) { |
| | | //url 转base64 |
| | | String base64Url = ImageUtils.imageUrlToBase64(userInfo.getFingerprint()); |
| | | userInfo.setFingerprint(base64Url); |
| | | } |
| | | return R.data(userInfo); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |
| | | @PostMapping("/reset-password") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "初始化密码", notes = "传入userId集合") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) { |
| | | boolean temp = userWxService.resetPassword(userIds); |
| | | return R.status(temp); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "删除", notes = "传入id集合") |
| | | public R remove(@RequestParam String ids) { |
| | | // CacheUtil.clear(USER_CACHE); |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | return R.status(userWxService.removeUser(ids)); |
| | | } |
| | | |
| | | } |