From 1b72bbfe21a0c7d53c2a63523526663e3d166968 Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Thu, 21 May 2020 14:21:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=88=B7=E6=96=B0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yixiang/modules/shop/rest/StoreCategoryController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java index 9d70b3a0..68a6fbf7 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/StoreCategoryController.java @@ -6,6 +6,7 @@ package co.yixiang.modules.shop.rest; import cn.hutool.core.util.StrUtil; +import co.yixiang.constant.ShopConstants; import co.yixiang.logging.aop.log.Log; import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxStoreCategory; @@ -15,6 +16,7 @@ import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria; import co.yixiang.utils.OrderUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.cache.annotation.CacheEvict; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -65,6 +67,7 @@ public class StoreCategoryController { @Log("新增商品分类") @ApiOperation(value = "新增商品分类") @PostMapping(value = "/yxStoreCategory") + @CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true) @PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_CREATE')") public ResponseEntity create(@Validated @RequestBody YxStoreCategory resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); @@ -78,6 +81,7 @@ public class StoreCategoryController { @Log("修改商品分类") @ApiOperation(value = "修改商品分类") + @CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true) @PutMapping(value = "/yxStoreCategory") @PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_EDIT')") public ResponseEntity update(@Validated @RequestBody YxStoreCategory resources){ @@ -91,6 +95,7 @@ public class StoreCategoryController { @Log("删除商品分类") @ApiOperation(value = "删除商品分类") + @CacheEvict(cacheNames = ShopConstants.YSHOP_REDIS_INDEX_KEY,allEntries = true) @DeleteMapping(value = "/yxStoreCategory/{id}") @PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_DELETE')") public ResponseEntity delete(@PathVariable String id){