Kaynağa Gözat

add cache config

zhouhao 7 yıl önce
ebeveyn
işleme
d9f539614c

+ 4 - 1
hsweb-system/hsweb-system-template/hsweb-system-template-service/hsweb-system-template-service-simple/src/main/java/org/hswebframework/web/service/template/simple/SimpleTemplateService.java

@@ -2,10 +2,12 @@ package org.hswebframework.web.service.template.simple;
 
 import org.hswebframework.web.dao.template.TemplateDao;
 import org.hswebframework.web.entity.template.TemplateEntity;
+import org.hswebframework.web.service.EnableCacheGenericEntityService;
 import org.hswebframework.web.service.GenericEntityService;
 import org.hswebframework.web.id.IDGenerator;
 import org.hswebframework.web.service.template.TemplateService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheConfig;
 import org.springframework.stereotype.Service;
 
 /**
@@ -14,7 +16,8 @@ import org.springframework.stereotype.Service;
  * @author hsweb-generator-online
  */
 @Service("templateService")
-public class SimpleTemplateService extends GenericEntityService<TemplateEntity, String>
+@CacheConfig(cacheNames = "template")
+public class SimpleTemplateService extends EnableCacheGenericEntityService<TemplateEntity, String>
         implements TemplateService {
     @Autowired
     private TemplateDao templateDao;