From 75de44cda0fb8dd35db4ba2c0fe501378ae9d9f6 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Wed, 27 Mar 2024 15:38:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E5=A2=9E):=20=E4=BD=BF=E7=94=A8C?= =?UTF-8?q?acheable=E6=8F=92=E5=85=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bunny <1319900154@qq.com> --- .../com/atguigu/product/service/impl/CategoryServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spzx-service/service-product/src/main/java/com/atguigu/product/service/impl/CategoryServiceImpl.java b/spzx-service/service-product/src/main/java/com/atguigu/product/service/impl/CategoryServiceImpl.java index 7c97b42..786d957 100644 --- a/spzx-service/service-product/src/main/java/com/atguigu/product/service/impl/CategoryServiceImpl.java +++ b/spzx-service/service-product/src/main/java/com/atguigu/product/service/impl/CategoryServiceImpl.java @@ -6,6 +6,7 @@ import com.atguigu.product.service.CategoryService; import com.atguigu.spzx.model.entity.product.Category; import com.atguigu.utils.CategoryHelper; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -46,6 +47,7 @@ public class CategoryServiceImpl implements CategoryService { * * @return 分类实体类列表 */ + @Cacheable(value = "category", key = "'all'") @Override public List findCategoryTree() { // 查询所以分类,返回list集合