Browse Source

🐛 岗位管理增加缓存清除

test
smallchill 5 years ago
parent
commit
3e9727aede
  1. 7
      blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java
  2. 1
      blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

7
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)));
}

1
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

@ -22,6 +22,7 @@
<result column="sex" property="sex"/>
<result column="role_id" property="roleId"/>
<result column="dept_id" property="deptId"/>
<result column="post_id" property="postId"/>
</resultMap>
<!-- 通用查询结果列 -->

Loading…
Cancel
Save