From 3e9727aedea58369dbde0e667487ddfd2344ac27 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 23 Apr 2020 10:21:55 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=B2=97=E4=BD=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/system/controller/PostController.java | 7 +++++++ .../java/org/springblade/system/user/mapper/UserMapper.xml | 1 + 2 files changed, 8 insertions(+) diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java index 94672f5c..c9e784bb 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; @@ -38,6 +39,8 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.util.List; +import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; + /** * 岗位表 控制器 * @@ -92,6 +95,7 @@ public class PostController extends BladeController { @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入post") public R save(@Valid @RequestBody Post post) { + CacheUtil.clear(SYS_CACHE); return R.status(postService.save(post)); } @@ -102,6 +106,7 @@ public class PostController extends BladeController { @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入post") public R update(@Valid @RequestBody Post post) { + CacheUtil.clear(SYS_CACHE); return R.status(postService.updateById(post)); } @@ -112,6 +117,7 @@ public class PostController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入post") public R submit(@Valid @RequestBody Post post) { + CacheUtil.clear(SYS_CACHE); return R.status(postService.saveOrUpdate(post)); } @@ -123,6 +129,7 @@ public class PostController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + CacheUtil.clear(SYS_CACHE); return R.status(postService.deleteLogic(Func.toLongList(ids))); } diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml b/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml index 91634443..e80bb010 100644 --- a/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml +++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml @@ -22,6 +22,7 @@ +