🐛 Fixing a bug. 租户查询不查询缓存,避免数据不一致

This commit is contained in:
冷冷 committed 2019-09-18 17:28:27 +08:00
1 parent 75a9e98c4b
commit 45bf557b6f
1 file changed
-7
@@ -21,14 +21,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.admin.api.entity.SysTenant;
import com.pig4cloud.pigx.admin.service.SysTenantService;
import com.pig4cloud.pigx.common.core.constant.CacheConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -80,7 +77,6 @@ public class SysTenantController {
@SysLog("新增租户")
@PostMapping
@PreAuthorize("@pms.hasPermission('admin_systenant_add')")
@CacheEvict(value = CacheConstants.TENANT_DETAILS, allEntries = true)
public R save(@RequestBody SysTenant sysTenant) {
return R.ok(sysTenantService.saveTenant(sysTenant));
}
@@ -94,7 +90,6 @@ public class SysTenantController {
@SysLog("修改租户")
@PutMapping
@PreAuthorize("@pms.hasPermission('admin_systenant_edit')")
@CacheEvict(value = CacheConstants.TENANT_DETAILS, allEntries = true)
public R updateById(@RequestBody SysTenant sysTenant) {
return R.ok(sysTenantService.updateById(sysTenant));
}
@@ -107,7 +102,6 @@ public class SysTenantController {
*/
@SysLog("删除租户")
@DeleteMapping("/{id}")
@CacheEvict(value = CacheConstants.TENANT_DETAILS, allEntries = true)
@PreAuthorize("@pms.hasPermission('admin_systenant_del')")
public R removeById(@PathVariable Integer id) {
return R.ok(sysTenantService.removeById(id));
@@ -120,7 +114,6 @@ public class SysTenantController {
*/
@Inner(value = false)
@GetMapping("/list")
@Cacheable(value = CacheConstants.TENANT_DETAILS)
public R list() {
return R.ok(sysTenantService.getNormal());
}