From 99312a646f55dc68019f9366950d673682493915 Mon Sep 17 00:00:00 2001 From: linfeng <2445465217@qq.com> Date: Mon, 21 Aug 2023 09:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=A8=A1=E5=9D=97=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/admin/controller/AppUserController.java | 7 ------- .../modules/admin/service/impl/AppUserServiceImpl.java | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) 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){