diff --git a/src/main/java/cn/chjyj/szwh/service/impl/GoodsDetailServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/GoodsDetailServiceImpl.java index 96b9591..bb79c75 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/GoodsDetailServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/GoodsDetailServiceImpl.java @@ -11,11 +11,13 @@ import com.alibaba.fastjson2.JSONObject; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheConfig; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional +@CacheConfig(cacheNames = "goodsDetail") public class GoodsDetailServiceImpl implements GoodsDetailService { // 日志 private static Log log = LogFactory.getLog(GoodsDetailServiceImpl.class); diff --git a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java index 8751f66..e209680 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java @@ -18,6 +18,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheConfig; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,6 +31,7 @@ import java.util.*; @Service @Transactional +@CacheConfig(cacheNames = "goods") public class GoodsServiceImpl implements GoodsService { private static Log log = LogFactory.getLog(GoodsServiceImpl.class); @Autowired diff --git a/src/main/java/cn/chjyj/szwh/service/impl/GoodsSourceServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/GoodsSourceServiceImpl.java index a94a855..a6efd36 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/GoodsSourceServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/GoodsSourceServiceImpl.java @@ -16,12 +16,14 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheConfig; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.*; @Service +@CacheConfig(cacheNames = "goodsSource") public class GoodsSourceServiceImpl implements GoodsSourceService { private Log log = LogFactory.getLog(GoodsSourceServiceImpl.class);