| | |
| | | @GetMapping("/danger/down") |
| | | @ApiOperation(value = "用户列表-保级条件降级", tags = {"管理后台"}) |
| | | public R down(Long id) { |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setVipId(byId.getVipId() - 1); |
| | | appUserService.updateById(byId); |
| | | AppUser appUser = appUserService.getById(id); |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setDelFlag(0); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(id); |
| | | userChangeLog.setBeforeVipId(appUser.getVipId()); |
| | | userChangeLog.setAfterVipId(appUser.getVipId() - 1); |
| | | userChangeLog.setChangeType(0); |
| | | userChangeLogService.save(userChangeLog); |
| | | appUser.setVipId(appUser.getVipId() - 1); |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | | |