diff --git a/src/main/java/io/linfeng/modules/admin/controller/AppUserController.java b/src/main/java/io/linfeng/modules/admin/controller/AppUserController.java index 7d7afe5..6f3f728 100644 --- a/src/main/java/io/linfeng/modules/admin/controller/AppUserController.java +++ b/src/main/java/io/linfeng/modules/admin/controller/AppUserController.java @@ -64,14 +64,7 @@ public class AppUserController { } - @PostMapping("/save") - @RequiresPermissions("admin:user:save") - @ApiOperation("用户保存") - public R save(@RequestBody AppUserEntity user){ - appUserService.save(user); - return R.ok(); - } @PostMapping("/update") diff --git a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java index 921a092..574fa32 100644 --- a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java +++ b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java @@ -97,6 +97,7 @@ public class AppUserServiceImpl extends ServiceImpl i @Override + @Transactional(rollbackFor = Exception.class) public void ban(Integer id) { Integer status = this.lambdaQuery().eq(AppUserEntity::getUid, id).one().getStatus(); if (status.equals(Constant.USER_BANNER)) { @@ -104,6 +105,7 @@ public class AppUserServiceImpl extends ServiceImpl i } this.lambdaUpdate() .set(AppUserEntity::getStatus, 1) + .set(AppUserEntity::getUpdateTime,new Date()) .eq(AppUserEntity::getUid, id) .update(); } @@ -117,6 +119,7 @@ public class AppUserServiceImpl extends ServiceImpl i } boolean update = this.lambdaUpdate() .set(AppUserEntity::getStatus, 0) + .set(AppUserEntity::getUpdateTime,new Date()) .eq(AppUserEntity::getUid, id) .update(); if(!update){