admin
2019-06-13 22a5179fbf4aed13dae767aff93d9ca047cba369
增加通用模板缓存
3个文件已修改
15 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dto/common/CommonContentResult.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/resource/ehcache.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/common/CommonContentResult.java
@@ -1,10 +1,12 @@
package com.yeshi.fanli.dto.common;
import java.io.Serializable;
import java.util.List;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
public class CommonContentResult {
public class CommonContentResult implements Serializable {
    private static final long serialVersionUID = 1L;
    private List<TaoBaoGoodsBrief> goodsList;
    private long count;
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonTemplateContentServiceImpl.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dto.common.CommonContentNav;
@@ -77,6 +78,9 @@
        return navList;
    }
    @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
    @Override
    public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
        if (type == CommonContentTypeEnum._9k9)
fanli/src/main/resource/ehcache.xml
@@ -196,4 +196,11 @@
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />    
    <!--通用模板内容缓存 -->
    <cache name="commonContentCache" maxElementsInMemory="1000"
        maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="120"
        timeToLiveSeconds="120" overflowToDisk="true"
        memoryStoreEvictionPolicy="LRU" />
</ehcache>