diff --git a/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java index b1d97bd2..e0e56bfa 100644 --- a/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java @@ -11,6 +11,8 @@ import io.renren.modules.category.service.CategoryService; import io.renren.modules.resource.dao.AttrDao; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -26,7 +28,9 @@ import java.util.concurrent.Executors; @Service public class CategoryServiceImpl extends CrudServiceImpl implements CategoryService { private static Integer cpuNUm = Runtime.getRuntime().availableProcessors(); - private static final ExecutorService executor = Executors.newFixedThreadPool(cpuNUm); + private static final ExecutorService executor = Executors.newCachedThreadPool(); + + private static final String getCategoryTreeKey = "getCategoryTree"; @Autowired private CategoryDao categoryDao; @@ -39,6 +43,7 @@ public class CategoryServiceImpl extends CrudServiceImpl getCategoryTree() { List topCategory = categoryDao.selectByParentId(null); List list = new CopyOnWriteArrayList<>(); @@ -82,6 +87,7 @@ public class CategoryServiceImpl extends CrudServiceImpl + + + \ No newline at end of file